]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 weeks agoMatch: Support unsigned scalar SAT_MUL form 14
Pan Li [Tue, 23 Jun 2026 13:04:44 +0000 (21:04 +0800)] 
Match: Support unsigned scalar SAT_MUL form 14

This patch would like to try to match the the unsigned
SAT_MUL form 14, aka below

  #define DEF_SAT_U_MUL_FMT_14(NT, WT)             \
  NT __attribute__((noinline))                     \
  sat_u_mul_##NT##_from_##WT##_fmt_14 (NT a, NT b) \
  {                                                \
    WT x = (WT)a * (WT)b;                          \
    NT hi = x >> (sizeof(NT) * 8);                 \
    NT lo = (NT)x;                                 \
    return hi == 0 ? lo : -1;                      \
  }

while WT is uint128_t, uint64_t, uint32_t and uint16_t, and
NT is uint64_t, uint32_t, uint16_t or uint8_t.

gcc/ChangeLog:

* match-sat-alu.pd: Add pattern for unsigned scalar
SAT_MUL form 14.

Signed-off-by: Pan Li <pan2.li@intel.com>
5 weeks agoconfigury: replace autoconf obsolete macros [PR103459]
Pietro Monteiro [Mon, 29 Jun 2026 01:09:16 +0000 (21:09 -0400)] 
configury: replace autoconf obsolete macros [PR103459]

Autoreconf -Wall complains about obsolete macros, so replace them according to
the autoconf documentation[0].

This patch doesn't fully fix all warnings because I focused on doing simple
fixes and keeping the changes to the generated files to a minimum.

[0]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

PR bootstrap/103459

ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
Replace AC_TRY_LINK with AC_LINK_IFELSE.

c++tools/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.

config/ChangeLog:

* acx.m4: Remove uses of AC_CHECK_TOOL_PREFIX.  Replace AC_TRY_COMPILE
with AC_COMPILE_IFELSE.
* asmcfi.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
* bitfields.m4: Likewise.
* cet.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.  Replace AC_TRY_RUN
with AC_RUN_IFELSE.
* codeset.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
* enable.m4: Replace AC_HELP_STRING with AS_HELP_STRING.
* gcc-plugin.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
* hwcaps.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace
AC_TRY_LINK with AC_LINK_IFELSE.
* isl.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
* lcmessage.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
* no-executables.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
Replace AC_TRY_LINK with AC_LINK_IFELSE.
* po.m4: Replace AC_OUTPUT_COMMANDS with AC_CONFIG_COMMANDS.
* tls.m4: Add explicit 4th argument to AC_LINK_IFELSE.

fixincludes/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.

gcc/ChangeLog:

* acinclude.m4: Replace AC_FOREACH with m4_foreach_w.  Replace
AC_TRY_LINK with AC_LINK_IFELSE.
* configure: Regenerate.
* configure.ac: Replace AC_HELP_STRING with AS_HELP_STRING.  Replace
AC_PROG_LIBTOOL with LT_INIT.

gnattools/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_HELP_STRING with AS_HELP_STRING.

gotools/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.

libada/ChangeLog:

* configure.ac: Replace AC_HELP_STRING with AS_HELP_STRING.

libatomic/ChangeLog:

* acinclude.m4: Replace AC_ERROR with AS_MSG_ERROR.  Replace AC_TRY_LINK
with AC_LINK_IFELSE.  Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
Replace AC_HELP_STRING with AS_HELP_STRING.  Replace
AC_TRY_RUN with AC_RUN_IFELSE.
* configure.ac: Replace AM_PROG_LIBTOOL with LT_INIT.  Replace
AC_STDC_HEADERS with AC_HEADER_STDC.

libbacktrace/ChangeLog:

* configure: Regenerate.
* configure.ac: Remove redundant AM_PROG_LIBTOOL.

libcc1/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.
Remove redundant AM_PROG_LIBTOOL.

libcpp/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.
Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.

libgcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_HELP_STRING with AS_HELP_STRING.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.

libgcobol/ChangeLog:

* configure: Regenerate.
* configure.ac: Remove redundant AM_PROG_LIBTOOL.

libgfortran/ChangeLog:

* acinclude.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
* configure.ac: Replace AC_LANG_C with AC_LANG([C]).  Replace
AM_PROG_LIBTOOL with LT_INIT.

libgm2/ChangeLog:

* acinclude.m4: Replace AC_HELP_STRING with AS_HELP_STRING.  Replace
AC_LANG_SAVE AC_LANG_CPLUSPLUS (...) AC_LANG_RESTORE with
AC_LANG_PUSH([C++]) (...) AC_LANG_POP([C++]).  Replace AC_TRY_LINK with
AC_LINK_IFELSE.  Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
* configure: Regenerate.
* configure.ac: Replace AC_HELP_STRING AS_HELP_STRING.  Remove redundant
AM_PROG_LIBTOOL.  Replace AC_LANG_C with AC_LANG([C]).  Replace
AC_FOREACH with m4_foreach_w.

libgomp/ChangeLog:

* acinclude.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace AC_HELP_STRING with
AS_HELP_STRING.  Replace AC_TRY_RUN with AC_RUN_IFELSE.
* configure: Regenerate.
* configure.ac: Replace AM_PROG_LIBTOOL with LT_INIT.  Replace
AC_STDC_HEADERS with AC_HEADER_STDC.  Replace _AC_COMPUTE_INT with
AC_COMPUTE_INT.

libgrust/ChangeLog:

* configure.ac: Replace AC_FOREACH with m4_foreach_w.

libiberty/ChangeLog:

* acinclude.m4: Replace AC_TRY_RUN with AC_RUN_IFELSE.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.
* configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace
AC_ISC_POSIX with AC_SEARCH_LIBS([strerror],[cposix]).

libitm/ChangeLog:

* acinclude.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace AC_HELP_STRING with
AS_HELP_STRING.  Replace AC_TRY_RUN with AC_RUN_IFELSE.
* configure.ac: Replace AM_PROG_LIBTOOL with LT_INIT.  Replace
AC_STDC_HEADERS with AC_HEADER_STDC.

libobjc/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.
Replace AM_PROG_LIBTOOL with LT_INIT. Remove unnecessary escape in
double quoted string.

libphobos/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.
Remove redundant AM_PROG_LIBTOOL.  Replace AC_FOREACH with m4_foreach_w.
* m4/druntime.m4: Replace AC_HELP_STRING AS_HELP_STRING.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.
* m4/druntime/cpu.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
* m4/druntime/os.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.

libquadmath/ChangeLog:

* configure.ac: Replace AM_PROG_LIBTOOL with LT_INIT.  Replace
AC_LANG_C with AC_LANG([C]).  Replace AC_TRY_COMPILE with
AC_COMPILE_IFELSE.  Replace AC_TRY_LINK with AC_LINK_IFELSE.

libsanitizer/ChangeLog:

* configure.ac: Replace AM_PROG_LIBTOOL with LT_INIT.  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace AC_FOREACH with
m4_foreach_w.

libssp/ChangeLog:

* configure.ac: Replace AC_LANG_C with AC_LANG([C]).  Replace
AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace AC_TRY_LINK with
AC_LINK_IFELSE.  Replace AM_PROG_LIBTOOL with LT_INIT.

libvtv/ChangeLog:

* configure.ac: Replace AC_GNU_SOURCE with AC_USE_SYSTEM_EXTENSIONS.
Replace AM_PROG_LIBTOOL with LT_INIT.  Replace AC_FOREACH with
m4_foreach_w.

lto-plugin/ChangeLog:

* configure: Regenerate.
* configure.ac: Replace AC_CANONICAL_SYSTEM with AC_CANONICAL_TARGET.
Replace AC_TRY_LINK with AC_LINK_IFELSE. Replace AM_PROG_LIBTOOL with
LT_INIT.

5 weeks agoDaily bump.
GCC Administrator [Mon, 29 Jun 2026 00:16:29 +0000 (00:16 +0000)] 
Daily bump.

5 weeks agoRemove BOOL_BITFIELD define from system.h and update its uses
Kevin Stefanov [Fri, 19 Jun 2026 19:37:25 +0000 (22:37 +0300)] 
Remove BOOL_BITFIELD define from system.h and update its uses

This change completely removes the BOOL_BITFIELD
macro from the codebase. All uses have been
replaced with bool.

PR middle-end/125274
gcc/c:
* c-decl.cc (c_binding): Replace BOOL_BITFIELD with bool.
(c_scope): Likewise.
* c-parser.cc (c_parser): Likewise.
* c-tree.h (c_declspecs): Likewise.
(c_arg_info): Likewise.
(c_declarator): Likewise.
gcc/cp:
* call.cc (conversion): Likewise.
* cp-tree.h (saved_scope): Likewise.
(language_function): Likewise.
(cp_decl_specifier_seq): Likewise.
(cp_declarator): Likewise.
* name-lookup.h (cp_binding_level): Likewise.
gcc/objc:
* objc-act.h (imp_entry): Likewise.
gcc/rust:
* backend/rust-tree.h (saved_scope): Likewise.
(rust_cp_binding_level): Likewise.
(language_function): Likewise.
gcc:
* ctfc.h (ctf_dtdef): Likewise.
* dwarf2out.cc (die_struct): Likewise.
* dwarf2out.h (dw_cfa_location): Likewise.
* gengtype-lex.l (IWORD): Remove BOOL_BITFIELD.
* gimple-walk.h (walk_stmt_info): Replace BOOL_BITFIELD with bool.
* opts.h (cl_option): Likewise.
* config/i386/i386.h (machine_frame_state): Likewise.
(machine_function): Likewise.
* sched-int.h (deps_desc): Likewise.
* sel-sched-ir.h (_expr): Likewise.
(_fence): Likewise.
(transformed_insns): Likewise.
(_sel_insn_data): Likewise.
* sel-sched.cc (cmpd_local_params): Likewise.
* system.h: Remove #define for BOOL_BITFIELD.

Signed-off-by: Kevin Stefanov <kevinstefanov15@gmail.com>
5 weeks agolibgomp: Update NVIDIA CUDA link
Gerald Pfeifer [Sun, 28 Jun 2026 18:39:11 +0000 (20:39 +0200)] 
libgomp: Update NVIDIA CUDA link

libgomp:
* libgomp.texi (nvptx): Update NVIDIA CUDA link.

5 weeks agoAVR: ad target/125752 - Simplify double -> 64-bit fixed conversions.
Georg-Johann Lay [Sun, 28 Jun 2026 10:08:04 +0000 (12:08 +0200)] 
AVR: ad target/125752 - Simplify double -> 64-bit fixed conversions.

When converting a fixed-point value to double, there is no need to
use ldexp to adjust for FBIT of the result.  Instead, FBIT can be
added to the double exponent without any further ado.  When the
input is +/-0.0 then the outcome of adding FBIT to the exponent
is a small number that __fix[uns]dfdi converts to 0.

PR target/125752
libgcc/config/avr/libf7/
* libf7.c (d_to_ufx, d_to_sfx): Remove prototypes.
(__fractdfda, __fractdfuda, __fractdfta, __fractdfuta)
(__fractdfdq, __fractdfudq): Move implementation to...
* libf7-asm.sx: ...here.
(d_to_fx64): Remove.
* libf7-common.mk (F7_ASM_PARTS): Add D2dq, D2udq, D2da,
D2uda, D2ta, D2uta.
(F7F_asm): Remove d_to_fx64.
* t-libf7 (LIBF7_DF_CONV): Remove fractdfda, fractdfta,
fractdfdq, fractdfuda, fractdfuta, fractdfudq.
* f7-renames.h: Rebuild.

5 weeks agoSH: Add reduced test case from PR55212 c#464 / att. 62360
Oleg Endo [Sun, 28 Jun 2026 09:07:45 +0000 (18:07 +0900)] 
SH: Add reduced test case from PR55212 c#464 / att. 62360

gcc/testsuite/ChangeLog:

PR target/55212
* gcc.target/sh/torture/pr55212-c464-1.c: New.
* gcc.target/sh/torture/pr55212-c464-2.c: New.

5 weeks agomatch: Canonicalize `(float)(a CMP b)` into `(a CMP b) ? 1.0 : 0.0` [PR115571]
Andrew Pinski [Tue, 12 May 2026 00:23:10 +0000 (17:23 -0700)] 
match: Canonicalize `(float)(a CMP b)` into `(a CMP b) ? 1.0 : 0.0` [PR115571]

Canonicalize `(type) (a CMP b)` to `(a CMP b) ? (type) true : (type) false` for
floating point types. fold-const already does this so it makes sense to do it on
the gimple level too. This also improves vectorization because a conversion
from a comparison to a float does not need to implemented and also if it is
implemented then selection of 1.0/0.0 is easier than the conversion would be.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/115571

gcc/ChangeLog:

* match.pd (`(float)(a CMP b)`): New pattern.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/float-conv-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
5 weeks agomatch: Use tree_expr_nonnegative_p instead of
Kael Andrew Alonzo Franco [Sat, 27 Jun 2026 21:56:29 +0000 (17:56 -0400)] 
match: Use tree_expr_nonnegative_p instead of

TYPE_UNSIGNED for MAX (A, B) (==,!=) 0 -> (A|B) (==,!=) 0 [PR125749]

tree_expr_nonnegative_p covers non negative signed type variables,
unlike TYPE_UNSIGNED.

Bootstrapped and tested on x86_64-pc-linux-gnu

PR tree-optimization/125749

gcc/ChangeLog:

PR tree-optimization/125749
* match.pd: Use tree_expr_nonnegative_p for MAX (A, B) (==,!=) 0 ->
(A|B) (==,!=) 0.

gcc/testsuite/ChangeLog:

PR tree-optimization/125749
* gcc.dg/pr125749.c: New test.

Signed-off-by: Kael Franco <kaelfandrew@gmail.com>
5 weeks agoDaily bump.
GCC Administrator [Sun, 28 Jun 2026 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

5 weeks agos390: Fix up *brx_stage1_<GPR:mode> [PR125992]
Jakub Jelinek [Sat, 27 Jun 2026 19:33:00 +0000 (21:33 +0200)] 
s390: Fix up *brx_stage1_<GPR:mode> [PR125992]

The following testcase is miscompiled since r16-3301 but the problem is much
older.
The *brx_stage1_<GPR:mode> define_insn_and_split pattern doesn't describe
that it clobbers CC_REGNUM, but splits (before reload) into something which
does clobber CC_REGNUM unconditionally.
Since r16-3301 on this testcase the late_combine1 pass figures it can extend
the lifetime of CC_REGNUM across such an instruction, but when it is in
split1 pass split into something that does clobber CC_REGNUM, the value from
earlier comparison till later use is not preserved anymore.

The following patch fixes it by adding clobber for CC_REGNUM even to the
*brx_stage1_<GPR:mode> pattern, so that df/late_combine etc. know that it is
CC_REGNUM is clobbered by it.
I had to put the clobber before the match_scratch clobber, otherwise there
is endless loop trying to split this insn in split1 pass, the insn it is
split into matches the pattern again and is split again etc. forever.
Even with this patch combine can match this insn, we have code to add the
missing clobbers if the register isn't live across it.

2026-06-27  Jakub Jelinek  <jakub@redhat.com>

PR target/125992
* config/s390/s390.md (*brx_stage1_<GPR:mode>): Add CC_REGNUM clobber.

* gcc.target/s390/pr125992.c: New test.

Reviewed-by: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
5 weeks agofixincl.c: Fix my previous patch for (const) char *
Filip Kastl [Sat, 27 Jun 2026 06:48:58 +0000 (08:48 +0200)] 
fixincl.c: Fix my previous patch for (const) char *

In my previous patch I changed a parameter of extract_quoted_files
from const char * to just char *.  I believe that's still the right call
but I overlooked that a string literal gets assigned to that variable
inside the function body.  That means we throw away constness of that
string literal and produce a warning during compilation of fixincl.c.

This patch fixes this by using a helper const char * variable.

fixincludes/ChangeLog:

* fixincl.c (extract_quoted_files): Add a const char * helper
variable.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
5 weeks agolibbacktrace: set table field for zstd RLE sequence
Ian Lance Taylor [Sat, 27 Jun 2026 16:06:36 +0000 (09:06 -0700)] 
libbacktrace: set table field for zstd RLE sequence

Patch from Ivan Molodetskikh.

* elf.c (elf_zstd_unpack_seq_decode): Set table field for RLE
sequence.
* zstdtest.c (tests): Add rle-sequence-tables test.

5 weeks agolibbacktrace: support window size in zstd decompression
Ian Lance Taylor [Sat, 27 Jun 2026 15:46:14 +0000 (08:46 -0700)] 
libbacktrace: support window size in zstd decompression

Reportedly this occurs on AerynOS.

Patch from Ivan Molodetskikh.

* elf.c (elf_zstd_decompress_frame): Support a compressed block
that does not set the single segment flag.
* zstdtest.c (tests): Add tests without single segment.

5 weeks agoRemove some wrong unused warnings, do not issue warnings if there are errors.
Thomas Koenig [Fri, 19 Jun 2026 15:35:37 +0000 (17:35 +0200)] 
Remove some wrong unused warnings, do not issue warnings if there are errors.

This patch fixes to omissions when variables were not set as referenced
and removes the warnings if errors have previously been issued.

gcc/fortran/ChangeLog:

PR fortran/30438
PR fortran/125801
* io.cc (gfc_resolve_dt): Set internal unit as used on read.o
* resolve.cc (resolve_transfer): Move setting value as used
before possible early return.
(gfc_resolve): Only call warn_unused_vs_set if there are no
pending errors.

gcc/testsuite/ChangeLog:

PR fortran/30438
PR fortran/125801
* gfortran.dg/warn_unused_but_set_error_1.f90: New test.
* gfortran.dg/warn_unused_intent_out_2.f90: New test.

5 weeks agotree-optimization: Use ranges for int-float comparisons [PR125385]
Eikansh Gupta [Fri, 26 Jun 2026 05:40:43 +0000 (11:10 +0530)] 
tree-optimization: Use ranges for int-float comparisons [PR125385]

When integer operands are converted to a floating-point type before a
comparison, the existing fold only checks whether the whole integer type
is exactly representable.  Use SSA range information as a fallback so
range-limited values, such as those masked to [0, 255], can be compared
directly as integers.  Apply the same range-aware exactness check to
integer-to-float comparisons against real constants.

PR tree-optimization/125385

gcc/ChangeLog:

* match.pd ((FTYPE) N CMP (FTYPE) M): Use range information
to decide whether integer operands are exactly representable.
((FTYPE) N CMP CST): Likewise.
* real.cc: Include backend.h and vr-values.h.
(format_helper::can_represent_range_value_p): New function.
* real.h (format_helper::can_represent_range_value_p): Declare.
* tree-core.h (class irange): Forward declare.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Eikansh Gupta <eikansh.gupta@oss.qualcomm.com>
5 weeks agopr125100-4.c: Adjust check-function-bodies for x32
H.J. Lu [Sat, 27 Jun 2026 05:34:20 +0000 (13:34 +0800)] 
pr125100-4.c: Adjust check-function-bodies for x32

PR target/125100
* gcc.target/i386/pr125100-4.c: Replace "movq  %rax, \(%rdi\)"
with "movq  %rax, \(%[re]di\)" to support x32.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agoDaily bump.
GCC Administrator [Sat, 27 Jun 2026 00:16:33 +0000 (00:16 +0000)] 
Daily bump.

5 weeks agoReplace the min size rtx with GEN_INT (min_size)
H.J. Lu [Fri, 26 Jun 2026 21:22:21 +0000 (05:22 +0800)] 
Replace the min size rtx with GEN_INT (min_size)

commit cbc56384029c9224280b0a1018fb9502797f243d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jun 26 08:43:20 2026 +0800

    determine_block_size: Set len_rtx to min size if min size == max size

added

+    gcc_assert (min_size != max_size
+           || rtx_equal_p (ops[2].value, ops[6].value));

But the number of operands isn't fixed and may be less than 7.  Replace
the min size rtx with GEN_INT (min_size) to support different numbers of
operands.

PR middle-end/125977
* expr.cc (emit_block_move_via_pattern): Replace ops[6].value
in assert with GEN_INT (min_size).

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agox86-64: Expand bounded memset and memcpy like memmove
H.J. Lu [Wed, 17 Jun 2026 09:32:21 +0000 (17:32 +0800)] 
x86-64: Expand bounded memset and memcpy like memmove

commit 401199377c50045ede560daf3f6e8b51749c2a87
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jun 17 10:17:17 2025 +0800

    x86: Improve vector_loop/unrolled_loop for memset/memcpy

uses move_by_pieces and store_by_pieces for memcpy and memset epilogues
with the fixed epilogue size.  Since move_by_pieces and store_by_pieces
don't use the maximum size info, they generate extra branches and moves
for bounded memcpy and memset.  Commit

commit b41f96465190751561f6909e858604ceab00595b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Oct 20 16:14:34 2025 +0800

x86-64: Inline memmove with overlapping unaligned loads and stores.

inlines memmove with overlapping unaligned and stores which reduces the
numbers of branches as well as moves when the maximum size is known.
Rename ix86_expand_movmem to ix86_expand_set_or_movmem and extend it to
inline bounded memcpy and memset.  Update ix86_expand_set_or_cpymem to
call ix86_expand_set_or_movmem for bounded memset and memcpy as memmove
if misaligned moves are preferred.

In addition to reduce 727.cppcheck_r O2 code size by ~9%, there're
another ~8 benchmarks whose code sizes are reduced >2% across spec2026
and spec2017 with march=x86-64-v3 O2, no big code size impact for Ofast,
performance impact is negligible(slightly better, but all under noise
range) for both O2 and Ofast.

gcc/

PR target/125856
PR target/125865
* config/i386/i386-expand.cc (ix86_expand_set_or_cpymem):
Call ix86_expand_set_or_movmem for
TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES.
(ix86_expand_memset_val): New.
(ix86_expand_n_move_movmem): Renamed to ...
(ix86_expand_n_move_set_or_movmem): This.  Add a pointer to rtx
argument for memset.  Also expand memset.
(ix86_expand_n_overlapping_move_movmem): Renamed to ...
(ix86_expand_n_overlapping_move_set_or_movmem): This.  Add a
pointer to rtx argument for memset.  Also expand memset.
(ix86_expand_less_move_movmem): Renamed to ...
(ix86_expand_less_move_set_or_movmem): This.  Add a pointer to
rtx argument for memset.  Also expand memset.
(ix86_expand_movmem): Renamed to ...
(ix86_expand_set_or_movmem): This.  Add bool arguments for memcpy
and memset.  Also expand memcpy and memset.
* config/i386/i386-protos.h (ix86_expand_movmem): Renamed to ...
(ix86_expand_set_or_movmem): This.  Add bool arguments for memcpy
and memset.
* config/i386/i386.md (movmem<mode>): Replace ix86_expand_movmem
with ix86_expand_set_or_movmem.

gcc/testsuite/

PR target/125856
PR target/125865
* gcc.target/i386/builtin-memcpy-1a.c: New test.
* gcc.target/i386/builtin-memcpy-1b.c: Likewise.
* gcc.target/i386/builtin-memcpy-2a.c: Likewise.
* gcc.target/i386/builtin-memcpy-2b.c: Likewise.
* gcc.target/i386/builtin-memcpy-2c.c: Likewise.
* gcc.target/i386/builtin-memcpy-3a.c: Likewise.
* gcc.target/i386/builtin-memcpy-3b.c: Likewise.
* gcc.target/i386/builtin-memcpy-3c.c: Likewise.
* gcc.target/i386/builtin-memcpy-4a.c: Likewise.
* gcc.target/i386/builtin-memcpy-4b.c: Likewise.
* gcc.target/i386/builtin-memcpy-4c.c: Likewise.
* gcc.target/i386/builtin-memcpy-5a.c: Likewise.
* gcc.target/i386/builtin-memcpy-5b.c: Likewise.
* gcc.target/i386/builtin-memcpy-5c.c: Likewise.
* gcc.target/i386/builtin-memcpy-6.c: Likewise.
* gcc.target/i386/builtin-memcpy-bounded-1a.c: Likewise.
* gcc.target/i386/builtin-memcpy-bounded-1b.c: Likewise.
* gcc.target/i386/builtin-memset-1a.c: Likewise.
* gcc.target/i386/builtin-memset-1b.c: Likewise.
* gcc.target/i386/builtin-memset-2a.c: Likewise.
* gcc.target/i386/builtin-memset-2b.c: Likewise.
* gcc.target/i386/builtin-memset-2c.c: Likewise.
* gcc.target/i386/builtin-memset-3a.c: Likewise.
* gcc.target/i386/builtin-memset-3b.c: Likewise.
* gcc.target/i386/builtin-memset-3c.c: Likewise.
* gcc.target/i386/builtin-memset-4a.c: Likewise.
* gcc.target/i386/builtin-memset-4b.c: Likewise.
* gcc.target/i386/builtin-memset-4c.c: Likewise.
* gcc.target/i386/builtin-memset-5a.c: Likewise.
* gcc.target/i386/builtin-memset-5b.c: Likewise.
* gcc.target/i386/builtin-memset-5c.c: Likewise.
* gcc.target/i386/builtin-memset-6a.c: Likewise.
* gcc.target/i386/builtin-memset-6b.c: Likewise.
* gcc.target/i386/builtin-memset-6c.c: Likewise.
* gcc.target/i386/builtin-memset-7a.c: Likewise.
* gcc.target/i386/builtin-memset-7b.c: Likewise.
* gcc.target/i386/builtin-memset-7c.c: Likewise.
* gcc.target/i386/builtin-memset-8.c: Likewise.
* gcc.target/i386/builtin-memset-bounded-1a.c: Likewise.
* gcc.target/i386/builtin-memset-bounded-1b.c: Likewise.

Co-Authored-By: Hongtao Liu <hongtao.liu@intel.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agoSupport overriding of CREATE_GCOV for test suite
Andi Kleen [Thu, 25 Jun 2026 20:28:49 +0000 (13:28 -0700)] 
Support overriding of CREATE_GCOV for test suite

create_gcov use is currently hard coded in the test suite. Allow to
override it with a environment variable similar to what the
autoprofiled bootstrap allows.

gcc/testsuite/ChangeLog:

* lib/profopt.exp (profopt-execute): Check if CREATE_GCOV env
variable exists and use it when there.

Signed-off-by: Andi Kleen <ak@gcc.gnu.org>
5 weeks agoc++/reflection: consteval-only type in splice-spec [PR125900]
Marek Polacek [Fri, 26 Jun 2026 18:09:38 +0000 (14:09 -0400)] 
c++/reflection: consteval-only type in splice-spec [PR125900]

In this test in the template for the

  std::println("{}", static_cast<int>(s.[:member:]));

line provokes a bogus "consteval-only expressions are only allowed
in a constant-evaluated context" error.  (Not the line before
because there we have an OVERLOAD because the second argument's
type isn't obvious, and so the whole thing is considered type-dep.)

A splice-specifier is [: constant-expression :], and [expr.const.defns]:
an expression or conversion is manifestly constant-evaluated if it is
a constant-expression.

So I think we shouldn't walk SPLICE_EXPRs in
check_out_of_consteval_use_r.

PR c++/125900

gcc/cp/ChangeLog:

* reflect.cc (check_out_of_consteval_use_r): Don't walk
SPLICE_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/expr18.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
5 weeks agoFortran: -fc-prototypes, deferred shape and deferred length dummies [PR125902]
Harald Anlauf [Thu, 25 Jun 2026 20:55:47 +0000 (22:55 +0200)] 
Fortran: -fc-prototypes, deferred shape and deferred length dummies [PR125902]

Commit r17-1785 fixed the C prototypes emitted by -fc-prototypes for
procedure interfaces with deferred shape and deferred length dummies, but
did not consistently detect when "#include <ISO_Fortran_binding.h>" was
needed.  Use common helper function to handle this.

PR fortran/125902

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (needs_CFI_cdesc): New helper function to
determine when struct CFI_cdesc_t is used.
(has_cfi_cdesc): Use it here...
(get_c_type_name): ... and here.

gcc/testsuite/ChangeLog:

* gfortran.dg/c-prototypes_2.F90: New test.

5 weeks agoi386: ix86_expand_sse_movcc improvements
Roger Sayle [Fri, 26 Jun 2026 15:20:05 +0000 (16:20 +0100)] 
i386: ix86_expand_sse_movcc improvements

This patch implements Alexander Monakov's suggestion from PR 123238.
Traditionally, the x86_64 backend implements VCOND_MASK using a three
instruction sequence of pand, pandn and por (requiring three registers),
however when op_true and op_false are both constant vectors, this can
be done using just two instructions, pand and pxor (requiring only two
registers).  This requires delaying forcing const_vector operands to
memory (the constant pool) as late as possible, including changing the
predicates on the define_expand patterns that call ix86_expand_sse_movcc
to (consistently) accept vector_or_const_vector_operand.

void f(char c[])
{
    for (int i = 0; i < 8; i++)
        c[i] = c[i] ? 'a' : 'c';
}

Before with -O2 (12 instructions):
f:      movq    (%rdi), %xmm0
        pxor    %xmm1, %xmm1
        movabsq $7016996765293437281, %rdx  // {'a','a','a'...}
        movabsq $7161677110969590627, %rax  // {'c','c','c'...}
        movq    %rdx, %xmm2
        pcmpeqb %xmm1, %xmm0
        movq    %rax, %xmm1
        pand    %xmm0, %xmm1
        pandn   %xmm2, %xmm0
        por     %xmm1, %xmm0
        movq    %xmm0, (%rdi)
        ret

After with -O2 (11 instructions):
f:      movq    (%rdi), %xmm0
        pxor    %xmm1, %xmm1
        movabsq $144680345676153346, %rdx  // {2,2,2...}
        movabsq $7016996765293437281, %rax  // {'a','a','a'...}
        pcmpeqb %xmm1, %xmm0
        movq    %rdx, %xmm1
        pand    %xmm1, %xmm0
        movq    %rax, %xmm1
        pxor    %xmm1, %xmm0
        movq    %xmm0, (%rdi)
        ret

2026-06-26  Roger Sayle  <roger@nextmovesoftware.com>
    Hongtao Liu  <hongtao.liu@intel.com>

gcc/ChangeLog
PR target/123238
* config/i386/i386-expand.cc: Delay calling force_reg on
op_true and op_false.  Generate an AND then XOR sequence
if op_true and op_false are both CONST_VECTOR_P.
* config/i386/mmx.md (vcond_mask_<mode>v4hi): Allow operands
1 and 2 to be vector_or_const_vector_operand.
(vcond_mask_<mode>v2hi): Likewise.
(vcond_mask_<mode><mmxintvecmodelower>): Likewise.
(vcond_mask_<mode><mode>): Likewise.
* config/i386/sse.md (vcond_mask_<mode><sseintvecmodelower>):
Likewise.
(vcond_mask_<mode><sseintvecmodelower>): Likewise.
(vcond_mask_v1tiv1ti): Likewise.
(vcond_mask_<mode><sseintvecmodelower>): Likewise.
(vcond_mask_<mode><sseintvecmodelower>): Likewise.
* config/i386/predicates.md (vector_or_0_or_1s_operand): Delete
predicate with no remaining uses.

gcc/testsuite/ChangeLog
PR target/123238
* gcc.target/i386/pr123238-2.c: New test case.

5 weeks agoi386: Restrict AVX-VNNI-INT8 insns to VEX encoding [PR125949]
vekumar [Thu, 25 Jun 2026 05:03:55 +0000 (10:33 +0530)] 
i386: Restrict AVX-VNNI-INT8 insns to VEX encoding [PR125949]

The vpdpb{ss,su,uu}d[s] instructions from AVX-VNNI-INT8 only have a VEX
encoding; the EVEX form of these operations is provided by AVX10.2.  A
target such as -march=znver6 enables AVX-VNNI-INT8 together with the
AVX-512 xmm/ymm16-31 register file but does not have AVX10.2.  The
vpdp<vpdotprodtype>_<mode> pattern used a single "v" alternative with a
"maybe_evex" prefix, so under register pressure the allocator could pick
xmm/ymm16-31 and the instruction was promoted to its EVEX form, which is
not available on such targets.

Add a VEX-only alternative that keeps the operands in xmm/ymm0-15
(enabled for AVX-VNNI-INT8) and gate the existing EVEX alternative on
AVX10.2.  When AVX10.2 is not available only the VEX alternative is
enabled, so the high registers are no longer used and the EVEX form is
never emitted.

gcc/ChangeLog:

PR target/125949
* config/i386/i386.md ("isa"): Add avxvnniint8.
("enabled"): Adjust for avxvnniint8.
* config/i386/sse.md (vpdp<vpdotprodtype>_<mode>): Adjust for
AVXVNNIINT8.

gcc/testsuite/ChangeLog:

PR target/125949
* gcc.target/i386/pr125949.c: New test.

5 weeks agos390: Deal with non-compare conditions during RTX costing [PR125972]
Stefan Schulze Frielinghaus [Fri, 26 Jun 2026 14:46:48 +0000 (16:46 +0200)] 
s390: Deal with non-compare conditions during RTX costing [PR125972]

During cprop we have to cost intermediate RTXs which may have
non-compare conditions as e.g. r108={(0x1)?r113:r109} which get folded
later on.

First seen with r16-5417-g97a7d568f3d720.

PR target/125972

gcc/ChangeLog:

* config/s390/s390.cc (s390_rtx_costs): Deal with non-compare
conditions during costing.  Also fix some indentation.

gcc/testsuite/ChangeLog:

* gcc.target/s390/pr125972.c: New test.

5 weeks agomiddle-end/125875 - incomplete guards on VEC_PERM_EXPR folding
Richard Biener [Fri, 26 Jun 2026 08:55:29 +0000 (10:55 +0200)] 
middle-end/125875 - incomplete guards on VEC_PERM_EXPR folding

This fixes up match.pd patterns using can_vec_perm_const_p on
existing permutations to indicate whether we are before or
after vector lowering.  For this to be correct we have to use
the new vec_perm_indices CTOR taking the actual permuted inputs
so can_vec_perm_const_p can also handle the vec_shl/vec_shr
expansion path.

PR middle-end/125875
* match.pd: When checking for !can_vec_perm_const_p also
allow variable permutes and use the vec_perm_indices CTOR
with the original tree operands.

* gcc.dg/torture/pr125875.c: New testcase.

5 weeks agoAdd tree_to_vec_perm_indices
Richard Biener [Fri, 19 Dec 2025 08:15:58 +0000 (09:15 +0100)] 
Add tree_to_vec_perm_indices

The following adds a function like tree_to_vec_perm_builder but
for building vec_perm_indices directly from all operands of a
VEC_PERM_EXPR.  This avoids errors such as shown in PR123175
and allows us to extract information from the permuted inputs
to implement vec_shl/vec_shr recognition in can_vec_perm_const_p,
making that fully cover what vector lowering will assess.

* vec-perm-indices.h (vec_perm_indices::new_vector): New overload.
(vec_perm_indices::input_bitwise_zero_p): New method.
(vec_perm_indices::m_input0_bitwise_zero_p,
vec_perm_indices::m_input1_bitwise_zero_p): New members.
(vec_perm_indices::vec_perm_indices): Adjust.
(tree_to_vec_perm_indices): Declare.
* vec-perm-indices.cc (vec_perm_indices::new_vector): New overload.
(vec_perm_indices::new_expanded_vector): Adjust.
(tree_to_vec_perm_indices): New function.
* optabs-query.cc (can_vec_perm_const_p): Handle permute
patterns mapping to vec_shl/vec_shr.
* tree-vect-generic.cc (lower_vec_perm): Move vec_shl/vec_shr
detection to can_vec_perm_const_p and simplify.

5 weeks agoAdd debug counter to ranger
Andrew MacLeod [Thu, 25 Jun 2026 20:09:39 +0000 (16:09 -0400)] 
Add debug counter to ranger

PR tree-optimization/125979
* dbgcnt.def: Add ranger_cnt.
* gimple-range.cc (gimple_ranger::range_of_expr): Add debug_cnt.
(gimple_ranger::range_on_entry): Likewise.
(gimple_ranger::range_on_exit): Likewise.
(gimple_ranger::range_on_edge); Likewise.
(gimple_ranger::range_of_stmt): Likewise
(dom_ranger::range_of_expr): Likewise.
(dom_ranger::range_on_edge): Likewise.
(dom_ranger::range_of_stmt): Likewise.

5 weeks agodetermine_block_size: Set len_rtx to min size if min size == max size
H.J. Lu [Fri, 26 Jun 2026 00:43:20 +0000 (08:43 +0800)] 
determine_block_size: Set len_rtx to min size if min size == max size

Update determine_block_size to set len_rtx to min size if min size ==
max size.

gcc/

PR middle-end/125977
* builtins.cc (determine_block_size): Change len_rtx to reference
and set it to min size if min size == max size.
* expr.cc (emit_block_move_via_pattern): Assert count == min_size
if min_size == max_size.
(set_storage_via_setmem): Likewise.

gcc/testsuite/

PR middle-end/125977
* g++.dg/pr125977.C: New test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agoAArch64: Make dispatch scheduling reachable on multi-issue cores
Pengfei Li [Sun, 21 Jun 2026 14:42:12 +0000 (14:42 +0000)] 
AArch64: Make dispatch scheduling reachable on multi-issue cores

Commit r16-4079-gc8bd7b2d550 added dispatch scheduling for AArch64.
However, in choose_ready(), the dispatch scheduling path was only
reachable when dfa_lookahead <= 0, or when the first ready insn was a
SCHED_GROUP_P insn. Commit r16-6155-g40d0f79577e then made SCHED_GROUP_P
insns bypass dispatch scheduling to prevent fusion pairs from being
split. As a result, the DFA lookahead path is preferred and dispatch
scheduling is effectively disabled for AArch64 multi-issue cores.

dfa_lookahead comes from the hook first_cycle_multipass_dfa_lookahead.
In current AArch64 implementation, it returns a positive issue rate
value for multi-issue cores unless sched_fusion is true. This patch adds
an IS_DISPATCH_ON check to that hook implementation so that the dispatch
scheduling path is reachable on dispatch-enabled AArch64 cores.

Bootstrapped and tested on aarch64-linux-gnu.

gcc/ChangeLog:

* config/aarch64/aarch64.cc
(aarch64_sched_first_cycle_multipass_dfa_lookahead): Return 0
when dispatch scheduling is enabled.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/dispatch_sched_1.c: New test.

5 weeks agolibstdc++: Test fs::status and fs::symlink_status with dir symlink
Jonathan Wakely [Fri, 26 Jun 2026 11:30:57 +0000 (12:30 +0100)] 
libstdc++: Test fs::status and fs::symlink_status with dir symlink

I realized that we didn't test that filesystem::status and
filesystem::symlink_status work correctly for directory symlinks.

For POSIX there's no reason it wouldn't Just Work, but for Windows
symlinks to directories and symlinks to regular files require different
handling. These tests will ensure that we get it right when Windows
symlinks are supported.

libstdc++-v3/ChangeLog:

* testsuite/27_io/filesystem/operations/status.cc: Check
handling of directory symlink.
* testsuite/27_io/filesystem/operations/symlink_status.cc:
Likewise.

5 weeks agoRemove HAVE_AS_IX86_QUAD
Rainer Orth [Fri, 26 Jun 2026 08:37:07 +0000 (10:37 +0200)] 
Remove HAVE_AS_IX86_QUAD

Every supported version of the Solaris/x86 assembler supports the .quad
directive, so HAVE_AS_IX86_QUAD is always defined with both as and gas.
This patch removes the configure check and guarded code.

Bootstrapped without regressions on i386-pc-solaris2.11,
amd64-pc-solaris2.11 with both the original Solaris 11.4 as and the
current one, and x86_64-pc-linux-gnu.

2026-06-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (gcc_cv_as_ix86_quad): Remove.
* configure: Regenerate.
* config.in: Likewise.
* config/i386/sol2.h [!HAVE_AS_IX86_QUAD] (ASM_QUAD): Don't undefine.

5 weeks agoRemove HAVE_AS_IX86_DIFF_SECT_DELTA
Rainer Orth [Fri, 26 Jun 2026 08:24:57 +0000 (10:24 +0200)] 
Remove HAVE_AS_IX86_DIFF_SECT_DELTA

Every supported version of the Solaris/x86 assembler supports
subtraction of symbols in different sections.  Therefore the
HAVE_AS_IX86_DIFF_SECT_DELTA is always defined with both as and gas and
can be removed.

Bootstrapped without regressions on i386-pc-solaris2.11,
amd64-pc-solaris2.11 with both the original Solaris 11.4 as and the
current one, and x86_64-pc-linux-gnu.

2026-06-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (gcc_cv_as_ix86_diff_sect_delta): Remove.
* configure: Regenerate.
* config.in: Likewise.
* config/i386/sol2.h [!HAVE_AS_IX86_DIFF_SECT_DELTA]
(ASM_PREFERRED_EH_DATA_FORMAT): Remove.
(JUMP_TABLES_IN_TEXT_SECTION): Likewise.
(ASM_OUTPUT_DWARF_PCREL): Likewise.

5 weeks agolibstdc++: Make bitset::reference a proper range proxy.
Tomasz KamiÅ„ski [Thu, 25 Jun 2026 11:28:04 +0000 (13:28 +0200)] 
libstdc++: Make bitset::reference a proper range proxy.

This implements remaining changes from P3612R1 Harmonize proxy-reference
operations (LWG 3638 and 4187).

As the const-assignment operator in bitset::reference (from LWG4187)
is used by range concepts (std::indirectly_writable) to recognize
iterator returning it by value as proxy iterator (see range_proxy.cc) test,
this change is backported to C++23. This puts it inline with vector<bool>
reference and other proxy type, for which the corresponding assignment
operator where added by P2321 in C++23 and implemented in r13-2159-g72886f.

Similary, a swap overloads accepting bitset::reference by value and bool&,
are necessary for ranges::swap and ranges::iter_swap to work correctly,
so they should also be backported. This patch follows the approach from
resolution of LWG3638 from r12-5311-g59434931fb658f, and backports the
overloads to C++11. This harmonizes the operations on this two proxy
types (per paper title). Corresponding test are added for both classes.

The deprecation warning for static vector<bool>::swap is added since C++26.
The text in _GLIBCXX26_DEPRECATED_SUGGEST leads to following message:
  'static constexpr void std::vector<bool, _Alloc>::swap(reference, reference)
  [with... ]' is deprecated: use 'swap' invoked via ADL or 'std::ranges::swap'
  instead

libstdc++-v3/ChangeLog:

* include/bits/stl_bvector.h: Add _GLIBCXX_RESOLVE_LIB_DEFECTS
comment for 3638.
(vector<bool, _Alloc>::operator=(bool) const)
[__glibcxx_ranges_zip]: Adjust guard.
(vector<bool, _Alloc>::swap): Add deprected attribute via
_GLIBCXX26_DEPRECATED_SUGGEST.
* include/std/bitset (bitset::operator=(bool) const)
[__glibcxx_ranges_zip]: Define.
(bistset::reference::swap) [__cplusplus >= 201103L]: Define.
* testsuite/20_util/bitset/access/range_proxy.cc: New test.
* testsuite/20_util/bitset/access/ref_swap.cc: New test.
* testsuite/23_containers/vector/bool/element_access/range_proxy.cc:
New test.
* testsuite/23_containers/vector/bool/element_access/ref_swap.cc:
New test.
* testsuite/23_containers/vector/bool/modifiers/swap/constexpr.cc:
Check for deprecated warning on static swap.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
5 weeks agoLoongArch: Fix parameter type for loongarch_sched_reassociation_width
Jiahao Xu [Fri, 26 Jun 2026 07:16:58 +0000 (15:16 +0800)] 
LoongArch: Fix parameter type for loongarch_sched_reassociation_width

Follow up to r17-1827-g92d206fab98, which changed the reassociation_width
target hook to use tree_code instead of unsigned int. This patch updates
loongarch_sched_reassociation_width to use the correct tree_code parameter
type to match the target hook definition.

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_sched_reassociation_width):
Get a tree_code instead of unsigned int.

5 weeks agox86: Add run-time memmove tests inlined with various bounds
H.J. Lu [Fri, 26 Jun 2026 04:14:45 +0000 (12:14 +0800)] 
x86: Add run-time memmove tests inlined with various bounds

Add run-time memmove tests inlined with various bounds with overlapping
source and destination.

* gcc.target/i386/builtin-memmove-bounded-1a.c: New test.
* gcc.target/i386/builtin-memmove-bounded-1b.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agofortran: [PR121972] Fix attribute used.
Jerry DeLisle [Fri, 26 Jun 2026 03:54:48 +0000 (20:54 -0700)] 
fortran: [PR121972] Fix attribute used.

PR fortran/121972

gcc/fortran/ChangeLog:

* trans-array.cc (has_class_alloc_comp): Change to atte.class_pointer.

6 weeks agoDaily bump.
GCC Administrator [Fri, 26 Jun 2026 00:16:54 +0000 (00:16 +0000)] 
Daily bump.

6 weeks agofortran: [PR118793] Provide expanded diagnostics for namelist read
Jerry DeLisle [Wed, 24 Jun 2026 01:17:27 +0000 (18:17 -0700)] 
fortran: [PR118793] Provide expanded diagnostics for namelist read

The change implements additional diagnostic information for namelist
read. In particular, error messages provide line number, column
position, the specific file name, and a portion of the input line
where the error ocurred.

PR libfortran/118793

libgfortran/ChangeLog:

* io/file_pos.c (st_rewind): Reset line and column numbers.
* io/io.h: Add line and column number to the gfc_unit
structure.
* io/list_read.c (next_char_default): Increment the column
position and line number as needed.
(next_char_internal): Likewise.
(next_char_utf8): Likewise.
(nml_err_ret): Build the expanded diagnostic message.
* io/unit.c (insert_unit): Initialize the line_number.

gcc/testsuite/ChangeLog:

* gfortran.dg/namelist_40.f90: Update expected dg-output.
* gfortran.dg/namelist_47.f90: Likewise

6 weeks agotestsuite, c, Darwin: Fix Mach-O issues in toplevel asm tests.
Iain Sandoe [Fri, 26 Jun 2026 10:41:38 +0000 (11:41 +0100)] 
testsuite, c, Darwin: Fix Mach-O issues in toplevel asm tests.

Current Darwin no longer supports non-pie executables, leading to spurious
fails because of linker warnings; skip these cases.

Several of the tests also needed updates for Mach-O ABI (e.g asm directive
spellings or USER_LABEL_PREFIX).  This fixes the UNRESOLVED cases but not
the actual fail of toplevel-simple-asm-2.

gcc/testsuite/ChangeLog:

* gcc.dg/lto/toplevel-extended-asm-1_0.c: Skip for Darwin.
* gcc.dg/lto/toplevel-extended-asm-2_0.c: Fix Mach-O syntax.
* gcc.dg/lto/toplevel-extended-asm-2_1.c: Likewise.
* gcc.dg/lto/toplevel-simple-asm-1_0.c: Skip for Darwin.
* gcc.dg/lto/toplevel-simple-asm-2_1.c: Fix Mach-O syntax.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
6 weeks agolibstdc++: Update feature test macros and tests for C++29
Jonathan Wakely [Thu, 25 Jun 2026 11:59:04 +0000 (12:59 +0100)] 
libstdc++: Update feature test macros and tests for C++29

With r17-1595-g0c5c6249a2e9a7 G++ supports -std=c++29 so update our
feature test macro generation and testsuite to know about it.

For the stds map in bits/version.def we can just use '> 20YYMM' for the
date of the previous standard, instead of '>= 20YYMM' with some
arbitrary value that's greater than the previous standard. For example
for C++23 we can use '> 202002L' instead of '>= 202100L'. This means we
won't need to update the values again in future, we can just add new
rows to the end.

For the testsuite, we bump the v3_max_std value to 29 which means that
tests that require c++23 or c++26 will be run with that standard and
also c++29.

libstdc++-v3/ChangeLog:

* include/bits/version.def (stds): Add C++29 value and adjust
C++23 and C++26 values.
* include/bits/version.h: Regenerate.
* testsuite/lib/libstdc++.exp (v3_max_std): Update to 29.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
6 weeks agogccrs: intrinsic: Enforce intrinsic signatures during the type checking
Enes Cevik [Wed, 17 Jun 2026 08:53:08 +0000 (11:53 +0300)] 
gccrs: intrinsic: Enforce intrinsic signatures during the type checking

This patch adds a validation mechanism to the typechecker. This mechanism
verifies intrinsic declarations against predefined signature rules. If
a signature is incorrect, the compiler emits the proper diagnostic and
prevents the malformed intrinsic from reaching the backend.

gcc/rust/ChangeLog:

* Make-lang.in: Add rust-hir-type-check-intrinsic.o.
* typecheck/rust-hir-type-check-implitem.cc
(TypeCheckTopLevelExternItem::visit): Check intrinsic signature.
* typecheck/rust-hir-type-check-intrinsic.cc: New file.
* typecheck/rust-hir-type-check-intrinsic.h: New file.

gcc/testsuite/ChangeLog:

* rust/compile/ctlz.rs: Fix incorrect intrinsic signature.
* rust/compile/ctlz_nonzero.rs: Likewise.
* rust/compile/cttz.rs: Likewise.
* rust/compile/cttz_nonzero.rs: Likewise.
* rust/compile/issue-4245.rs: Likewise.
* rust/compile/torture/intrinsics-3.rs: Likewise.
* rust/execute/torture/ctlz.rs: Likewise.
* rust/execute/torture/ctlz_i16.rs: Likewise.
* rust/execute/torture/ctlz_i32.rs: Likewise.
* rust/execute/torture/ctlz_i64.rs: Likewise.
* rust/execute/torture/ctlz_i8.rs: Likewise.
* rust/execute/torture/ctlz_nonzero.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_i16.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_i32.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_i64.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_i8.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_u16.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_u32.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_u64.rs: Likewise.
* rust/execute/torture/ctlz_nonzero_u8.rs: Likewise.
* rust/execute/torture/ctlz_u16.rs: Likewise.
* rust/execute/torture/ctlz_u32.rs: Likewise.
* rust/execute/torture/ctlz_u64.rs: Likewise.
* rust/execute/torture/ctlz_u8.rs: Likewise.
* rust/execute/torture/cttz.rs: Likewise.
* rust/execute/torture/cttz_nonzero.rs: Likewise.
* rust/compile/intrinsic-checker.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: intrinsic: Use Values::Intrinsics instead of raw strings in builtin map
Enes Cevik [Wed, 17 Jun 2026 08:44:14 +0000 (11:44 +0300)] 
gccrs: intrinsic: Use Values::Intrinsics instead of raw strings in builtin map

This patch adds builtin intrinsic names to Values::Intrinsics class and
updates the BuiltinContext mappings to use these constants instead of
hardcoded raw strings.

gcc/rust/ChangeLog:

* backend/rust-builtins.cc
(BuiltinsContext::register_rust_mappings): Use Values::Intrinsics
constants instead of raw strings.
* util/rust-intrinsic-values.h (class Intrinsics): Add missing
builtin intrinsics.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: Move a test into compile/macros/mbe
Owen Avery [Tue, 23 Jun 2026 02:47:54 +0000 (22:47 -0400)] 
gccrs: Move a test into compile/macros/mbe

This test should go in the folder for "macros by example", not the
top level rust compile test folder.

gcc/testsuite/ChangeLog:

* rust/compile/attr-macro.rs: Move to...
* rust/compile/macros/mbe/macro_attr_expr.rs: ...here.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
6 weeks agogccrs: intrinsic: Add min_align_of
Enes Cevik [Mon, 8 Jun 2026 15:05:22 +0000 (18:05 +0300)] 
gccrs: intrinsic: Add min_align_of

This patch implements the 'min_align_of' compiler intrinsic. It
resolves the minimum alignment of a given compile-time sized type
and returns it as a size_type_node integer constant expression.

gcc/rust/ChangeLog:

* backend/rust-compile-intrinsic.cc (generic_intrinsics): Add
min_align_of to map.
* backend/rust-intrinsic-handlers.cc (min_align_of_handler):
New function.
* backend/rust-intrinsic-handlers.h (min_align_of_handler):
New declaration.

gcc/testsuite/ChangeLog:

* rust/execute/min_align_of.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: typecheck: Special case builtin types when typechecking types.
Arthur Cohen [Wed, 10 Jun 2026 15:49:03 +0000 (17:49 +0200)] 
gccrs: typecheck: Special case builtin types when typechecking types.

Type definition conflicts are allowed in the case of builtin types. This is used in the
`core` crate to add some more functionality to the builtin types. The consequence of this
is that we need to special case the resolution of types in the case that their name could
refer to a module or to a builtin type.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Add
special casing for resolving to the builtin type definition if the found type
has the same name and is a module.

gcc/testsuite/ChangeLog:

* rust/compile/type-with-builtin-type-name.rs: New test.

6 weeks agogccrs: nr: Remove hack around resolving modules
Arthur Cohen [Fri, 29 May 2026 13:37:48 +0000 (15:37 +0200)] 
gccrs: nr: Remove hack around resolving modules

Remove the previous hack that was used for resolver module names in the Types NS. Modules now
get properly inserted, and this hack causes conflicts when a module and value share the same
name.

gcc/rust/ChangeLog:

* resolve/rust-name-resolution-context.hxx: Remove hacks.

gcc/testsuite/ChangeLog:

* rust/compile/issue-4563.rs: New test.

6 weeks agogccrs: nr: Add modules to types NS
Arthur Cohen [Wed, 21 Jan 2026 18:00:17 +0000 (19:00 +0100)] 
gccrs: nr: Add modules to types NS

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_module_id): New function.
(Mappings::is_module): Likewise.
* util/rust-hir-map.h: Store a set of AST modules, declare functions for adding and
retrieving them.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Insert modules in the type
namespace and store them in mappings.
* resolve/rust-late-name-resolver-2.0.cc (resolve_type_path_like): Error out when an
expected type resolves to a module.
* resolve/rust-name-resolution.h: Add empty Definition constructor.
* resolve/rust-resolve-builtins.cc (find_builtin_node_id): New function.
* resolve/rust-resolve-builtins.h: Declare it.

gcc/testsuite/ChangeLog:

* rust/compile/mod_in_types_ns.rs: New test.
* rust/compile/mod_in_types_ns2.rs: New test.

6 weeks agogccrs: Search lang_prelude when reaching module boundary during name resolution
Yap Zhi Heng [Sat, 6 Jun 2026 02:56:19 +0000 (10:56 +0800)] 
gccrs: Search lang_prelude when reaching module boundary during name resolution

gcc/rust/ChangeLog:

* resolve/rust-name-resolution-context.h (NameResolutionContext): Add new function
definition for `should_search_prelude`.
* resolve/rust-name-resolution-context.hxx (NameResolutionContext::should_search_prelude):
Add implementation.
(NameResolutionContext::resolve_segments): Update the check to trigger lang_prelude search
during name resolution in modules.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
6 weeks agogccrs: Clean up drop compile headers
Lishin [Thu, 11 Jun 2026 09:24:45 +0000 (09:24 +0000)] 
gccrs: Clean up drop compile headers

Move DropCandidate into a small drop-specific header and fix the
include sturcture.

Also add missing copyright headers, fix the include guard name, and
assert that Drop lookup returns a single function candidate.

gcc/rust/ChangeLog:

* backend/rust-compile-context.h: Include
rust-compile-drop-candidate.h instead of rust-compile-drop.h.
* backend/rust-compile-drop.cc: Add copyright header.
(CompileDrop::compile_drop_call): Assert that Drop lookup returns a
single function candidate.
* backend/rust-compile-drop.h: Add copyright header. Include
rust-compile-context.h.
(RUST_COMPILE_DROP): Rename to...
(RUST_COMPILE_DROP_H): ...this.
(DropCandidate): Move to...
* backend/rust-compile-drop-candidate.h: ...this new file.

Signed-off-by: Lishin <lishin1008@gmail.com>
6 weeks agogccrs: add drops at the end of function bodies
lishin [Tue, 9 Jun 2026 16:04:55 +0000 (17:04 +0100)] 
gccrs: add drops at the end of function bodies

Add function-scope Drop support for the implicit return case.
Add two test cases. This does not yet support explicit return.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::compile_function_body):
Add drop calls at the end of function bodies.

gcc/testsuite/ChangeLog:

* rust/execute/drop-function-scope-unit.rs: New test.
* rust/execute/drop-function-scope.rs: New test.

Signed-off-by: lishin <lishin1008@gmail.com>
6 weeks agogccrs: move Drop helpers to separate files
Lishin [Fri, 5 Jun 2026 09:48:25 +0000 (09:48 +0000)] 
gccrs: move Drop helpers to separate files

Refactor helper code into separate rust-compile-drop files.
This keeps the Drop-related logic in one place.

gcc/rust/ChangeLog:

* Make-lang.in: Add rust-compile-drop.o.
* backend/rust-compile-block.cc (compile_drop_call): Move to CompileDrop.
(CompileBlock::visit): Use CompileDrop to emit scope drop calls.
* backend/rust-compile-context.h (struct DropCandidate): Move to rust-compile-drop.h.
* backend/rust-compile-pattern.cc (type_has_drop_impl): Move to CompileDrop.
(CompilePatternLet::visit): Use CompileDrop to check Drop impls.
* backend/rust-compile-drop.cc: New file.
* backend/rust-compile-drop.h: New file.

Signed-off-by: Lishin <lishin1008@gmail.com>
6 weeks agogccrs: report unsupported Drop ref patterns
lishin [Tue, 2 Jun 2026 09:52:39 +0000 (09:52 +0000)] 
gccrs: report unsupported Drop ref patterns

Add an unsupported error for ref patterns and subpatterns.
Add an unsupported ref-pattern test case,
and extend the existing block-exit test case.

gcc/rust/ChangeLog:

* backend/rust-compile-pattern.cc (CompilePatternLet::visit): Check ref
pattern base types and emit a sorry for unsupported Drop ref/subpatterns.

gcc/testsuite/ChangeLog:

* rust/execute/drop-block-scope.rs: Extend test coverage for simple
immutable and mutable bindings.
* rust/compile/drop-ref-pattern.rs: New test.

Signed-off-by: lishin <lishin1008@gmail.com>
6 weeks agogccrs: add block-exit Drop calls
lishin [Fri, 29 May 2026 17:59:00 +0000 (17:59 +0000)] 
gccrs: add block-exit Drop calls

Add a helper for building Drop calls, and use it when leaving a block.
Add a block-exit test case.

gcc/rust/ChangeLog:

* backend/rust-compile-block.cc (compile_drop_call): New helper to
build a drop call.
(CompileBlock::visit): Add drop calls for candidates.
* backend/rust-compile-pattern.cc (type_has_drop_impl): New helper to
check whether a type implements Drop.
(CompilePatternLet::visit): Save initialized simple drop candidates.

gcc/testsuite/ChangeLog:

* rust/execute/drop-block-scope.rs: New test.

Signed-off-by: lishin <lishin1008@gmail.com>
6 weeks agogccrs: add block drop candidate tracking infrastructure
lishin [Fri, 29 May 2026 17:42:13 +0000 (17:42 +0000)] 
gccrs: add block drop candidate tracking infrastructure

Add the basic structure for saving local variables that may need Drop.

gcc/rust/ChangeLog:

* backend/rust-compile-context.h (struct DropCandidate): New struct
for tracking block-local drop candidates.

Signed-off-by: lishin <lishin1008@gmail.com>
6 weeks agogccrs: attr: Add attributes rustc_allocator and rustc_allocator_nounwind
Enes Cevik [Mon, 25 May 2026 16:00:08 +0000 (19:00 +0300)] 
gccrs: attr: Add attributes rustc_allocator and rustc_allocator_nounwind

This patch introduces the `rustc_allocator` and `rustc_allocator_nounwind`
attributes.
These attributes instruct the GCC backend to apply `malloc` and `nothrow`.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Dispatch the new
attributes.
(HIRCompileBase::handle_rustc_allocator_on_fndecl): New function.
(HIRCompileBase::handle_rustc_allocator_nounwind_on_fndecl): New function.
* backend/rust-compile-base.h (handle_rustc_allocator_on_fndecl): New declaration.
(handle_rustc_allocator_nounwind_on_fndecl): Likewise.
* util/rust-attribute-values.h (Attributes): Add RUSTC_ALLOCATOR and
RUSTC_ALLOCATOR_NOUNWIND constexprs.
* util/rust-attributes.cc (__definitions): Register rustc_allocator and
rustc_allocator_nounwind in the BuiltinAttributes list.
* checks/errors/rust-builtin-attribute-checker.cc (rustc_allocator): New function.
(rustc_allocator_nounwind): New function.
(attribute_checking_handlers): Add rustc_allocator and rustc_allocator_nounwind
functions.

gcc/testsuite/ChangeLog:

* rust/compile/attr-allocator1.rs: New test.
* rust/compile/attr-allocator2.rs: New test.
* rust/compile/attr-allocator3.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: attr: Add attribute rustc_std_internal_symbol
Enes Cevik [Mon, 25 May 2026 13:57:09 +0000 (16:57 +0300)] 
gccrs: attr: Add attribute rustc_std_internal_symbol

This patch introduces the `rustc_std_internal_symbol` attribute.
This attribute is required by the Rust standard library to prevent
name mangling for internal runtime symbols.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (should_mangle_item): Bypass
mangling for rustc_std_internal_symbol.
(HIRCompileBase::setup_fndecl): Dispatch the new attribute.
(HIRCompileBase::handle_rustc_std_internal_symbol_attribute_on_fndecl):
New function.
* backend/rust-compile-base.h:
(handle_rustc_std_internal_symbol_attribute_on_fndecl): New declaration.
* util/rust-attribute-values.h (Attributes): Add
RUSTC_STD_INTERNAL_SYMBOL constexpr.
* util/rust-attributes.cc (__definitions): Register
rustc_std_internal_symbol in the BuiltinAttributes list.
* checks/errors/rust-builtin-attribute-checker.cc (rustc_std_internal_symbol):
New function.
(attribute_checking_handlers): Add rustc_std_internal_symbol function.

gcc/testsuite/ChangeLog:

* rust/compile/rustc_std_internal_symbol1.rs: New test.
* rust/compile/rustc_std_internal_symbol2.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: Remove reduntant as_string calls.
Enes Cevik [Wed, 3 Jun 2026 09:20:32 +0000 (12:20 +0300)] 
gccrs: Remove reduntant as_string calls.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
Remove reduntant as_string calls.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: Add a new test for float literals
Pierre-Emmanuel Patry [Fri, 5 Jun 2026 14:32:57 +0000 (16:32 +0200)] 
gccrs: Add a new test for float literals

utf8_identifiers test has been changed to narrow it's scope. This change
means the test does not cover the unsuffixed float anymore and we aim to
fix that with a new separate test.

gcc/testsuite/ChangeLog:

* rust/compile/float_literals.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6 weeks agogccrs: Fix use after move in lexer
Pierre-Emmanuel Patry [Fri, 5 Jun 2026 13:33:36 +0000 (15:33 +0200)] 
gccrs: Fix use after move in lexer

The str variable was left in an unspecified but valid state after the
prior move on the same line. This lead to a value of zero on some
platforms and the prefix was considered empty.

gcc/rust/ChangeLog:

* lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Prevent use
after move.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6 weeks agogccrs: aarch64: Work around regression in PR 125600
Arthur Cohen [Thu, 4 Jun 2026 13:11:37 +0000 (15:11 +0200)] 
gccrs: aarch64: Work around regression in PR 125600

Commit 2e6d90ba (Defer literal suffix validation) caused a regression on
aarch64 with an invalid error on one of our testcases.

Since the testcase only concerns the parsing of UTF-8 identifiers, work
around the regression by modifying the testcase itself.

We opened Rust-GCC#4575 to address the issue later on, but let's restore
the aarch64 build in the meantime.

gcc/testsuite/ChangeLog:

* rust/compile/torture/utf8_identifiers.rs: Use a more classical
looking float value to test our UTF-8 identifier.

6 weeks agogccrs: compile-expr: Rename lookup_temp_var
Arthur Cohen [Wed, 3 Jun 2026 09:35:48 +0000 (11:35 +0200)] 
gccrs: compile-expr: Rename lookup_temp_var

Since this function is only used in a labels context, let's make it clearer.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Call the new name.
(CompileExpr::lookup_temp_var): Rename it to...
(CompileExpr::lookup_label_temp_var): ...this.
* backend/rust-compile-expr.h: Likewise.

6 weeks agogccrs: unsafe: Lookup PathInExpression nodes in both the Types and Values NS.
Arthur Cohen [Wed, 3 Jun 2026 09:29:56 +0000 (11:29 +0200)] 
gccrs: unsafe: Lookup PathInExpression nodes in both the Types and Values NS.

gcc/rust/ChangeLog:

* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Add Types as a
namespace in which to lookup PathInExpressions.

6 weeks agogccrs: privacy-reporter: Check for resolved nodes in more namespaces
Arthur Cohen [Wed, 3 Jun 2026 09:28:38 +0000 (11:28 +0200)] 
gccrs: privacy-reporter: Check for resolved nodes in more namespaces

And improve code factoring to reduce the complexity of the check_for_privacy_violation function.

gcc/rust/ChangeLog:

* checks/errors/privacy/rust-privacy-reporter.cc
(PrivacyReporter::check_for_privacy_violation): Add new overload for two namespaces.
(PrivacyReporter::visit): Call it.
(PrivacyReporter::check_violation_inner): New function.
* checks/errors/privacy/rust-privacy-reporter.h: Declare it.

6 weeks agogccrs: nr: Add lookup(ns1, ns2, ns3)
Arthur Cohen [Wed, 3 Jun 2026 09:25:11 +0000 (11:25 +0200)] 
gccrs: nr: Add lookup(ns1, ns2, ns3)

Which enables looking up resolved nodes in three different namespaces.
This is used in select cases but still important.

gcc/rust/ChangeLog:

* resolve/rust-finalized-name-resolution-context.cc
(FinalizedNameResolutionContext::lookup): New function.
* resolve/rust-finalized-name-resolution-context.h: Declare it.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::lookup): New function.
* resolve/rust-name-resolution-context.h: Declare it.

6 weeks agogccrs: nr: Improve documentation around FinalizedNameResolutionContext
Arthur Cohen [Wed, 3 Jun 2026 09:23:57 +0000 (11:23 +0200)] 
gccrs: nr: Improve documentation around FinalizedNameResolutionContext

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_simple_import): Cleanup
dead code.
(Early::finalize_rebind_import): Likewise.
* resolve/rust-finalized-name-resolution-context.h: Add class documentation.

6 weeks agogccrs: nr: Disable flatten function for now
Arthur Cohen [Wed, 3 Jun 2026 09:22:27 +0000 (11:22 +0200)] 
gccrs: nr: Disable flatten function for now

gcc/rust/ChangeLog:

* resolve/rust-forever-stack.h: Comment out flatten with an explanation.
* resolve/rust-forever-stack.hxx: Likewise.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::flatten): Likewise.
* resolve/rust-name-resolution-context.h: Likewise.

6 weeks agogccrs: nr: Remove unused locus in finalize_rebind_import.
Arthur Cohen [Thu, 21 May 2026 13:52:42 +0000 (15:52 +0200)] 
gccrs: nr: Remove unused locus in finalize_rebind_import.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc
(Early::finalize_rebind_import): Remove locus variable.

6 weeks agogccrs: resolve: Use definition IDs directly and fix ICEs
Enes Cevik [Sun, 3 May 2026 12:02:08 +0000 (15:02 +0300)] 
gccrs: resolve: Use definition IDs directly and fix ICEs

This patch fixes multiple ICEs and test failures in the Name Resolution 2.0

- Map directly to definition IDs instead of intermediate import IDs.
- Remove redundant `flatten()` calls. Flattening stripped generic  arguments
  from aliases like `Self`, causing typecheck errors.
- Prevent ICEs on invalid `use self;` imports by adding early returns.
- Add `Namespace::Types` to pattern lookups to correctly emit E0532 instead
  of crashing.
- Remove an unsafe debug loop in `Rib::get` that caused ICEs on  ambiguous names.
- Use `value_or` for safe optional unwrapping in module resolution.

gcc/rust/ChangeLog:

* checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Add Types namespace
lookup.
* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit): Use safe optional
unwrapping.
* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::visit): Likewise.
* checks/lints/unused/rust-unused-collector.h: Use helper for multiple namespace lookups.
* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_simple_import): Prevent ICE on
single self imports.
(Early::finalize_rebind_import): Return early to prevent ICE.
* resolve/rust-name-resolution-context.hxx: Use value_or for safe leaf module lookup.
* rust-session-manager.cc (Session::compile_crate): Remove obsolete flatten() calls.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Look up enum variants
in Types namespace.

Signed-off-by: Enes Cevik <nsvke@proton.me>
6 weeks agogccrs: nr: Separate APIs properly for flattening.
Arthur Cohen [Fri, 24 Apr 2026 16:14:07 +0000 (18:14 +0200)] 
gccrs: nr: Separate APIs properly for flattening.

Namespaces, flattening and resolved_nodes are all properly separated now and in the files
where they should be.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::try_insert_once): Use new
Usage -> Definition map for macros.
* resolve/rust-finalized-name-resolution-context.cc
(FinalizedNameResolutionContext::map_usage): Dispatch to proper resolution map.
* resolve/rust-forever-stack.h (enum class LookupFinalizeError): Move here.
* resolve/rust-forever-stack.hxx: Make resolution take a resolve_segment lambda with
an extra namespace parameter.
* resolve/rust-name-resolution-context.hxx: Likewise.
* resolve/rust-name-resolution-context.cc (find_leaf_definition_inner): Move here...
(NameResolutionContext::find_leaf_definition): Likewise.
(NameResolutionContext::flatten): Likewise.
* resolve/rust-name-resolution-context.h: ...from here.

6 weeks agogccrs: nr2.0: Fix resolve_path_in_all_ns
Arthur Cohen [Fri, 24 Apr 2026 15:20:58 +0000 (17:20 +0200)] 
gccrs: nr2.0: Fix resolve_path_in_all_ns

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.h: Properly insert resolutions in
the returned vector as that was previously missing.

6 weeks agogccrs: marklive: Allow looking up variables in types NS as well
Arthur Cohen [Wed, 22 Apr 2026 07:47:43 +0000 (09:47 +0200)] 
gccrs: marklive: Allow looking up variables in types NS as well

gcc/rust/ChangeLog:

* checks/lints/rust-lint-marklive.cc (MarkLive::find_value_definition): Use Types NS
alongside Values NS for lookup.

6 weeks agogccrs: nr: Add more namespace lookup APIs
Arthur Cohen [Tue, 21 Apr 2026 03:04:54 +0000 (05:04 +0200)] 
gccrs: nr: Add more namespace lookup APIs

Add more functions for looking up Usage(s) in multiple namespaces.

gcc/rust/ChangeLog:

* resolve/rust-finalized-name-resolution-context.cc
(FinalizedNameResolutionContext::lookup): New function.
* resolve/rust-finalized-name-resolution-context.h: Declare it.
* resolve/rust-forever-stack.h: Remove assertion in map_usage.
* resolve/rust-name-resolution-context.h: Add new NSLookup return type.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::lookup): Use it.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise.

6 weeks agogccrs: nr: Create new APIs to specify namespaces in which usages should be looked-up.
Arthur Cohen [Thu, 21 May 2026 13:25:22 +0000 (15:25 +0200)] 
gccrs: nr: Create new APIs to specify namespaces in which usages should be looked-up.

This fundamentally changes the way that NR works for later pipeline - instead of having one
singular Usage -> Definition map like it was before, the consumers of finalized NRCtx need to
specify in which namespace(s) they expect usages to be looked-up. We now have one usage map
for each namespace, and add new APIs for looking up usages in one or multiple namespaces.

gcc/rust/ChangeLog:

* backend/rust-compile-implitem.cc (CompileTraitItem::visit): Adapt for new NR APIs.
* backend/rust-compile-item.cc (CompileItem::visit): Likewise.
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Likewise.
* checks/errors/borrowck/rust-bir-builder-internal.h: Likewise.
* checks/errors/privacy/rust-privacy-reporter.cc
(PrivacyReporter::check_for_privacy_violation): Likewise.
(PrivacyReporter::check_base_type_privacy): Likewise.
(PrivacyReporter::visit): Likewise.
* checks/errors/privacy/rust-privacy-reporter.h: Likewise.
* checks/errors/privacy/rust-visibility-resolver.cc
(VisibilityResolver::resolve_module_path): Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise.
* checks/errors/rust-readonly-check.cc (ReadonlyChecker::visit): Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::visit): Likewise.
(MarkLive::visit_path_segment): Likewise.
(MarkLive::find_ref_node_id): Likewise.
(MarkLive::find_value_definition): Likewise.
* checks/lints/rust-lint-marklive.h: Likewise.
* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit): Likewise.
* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::visit): Likewise.
* checks/lints/unused/rust-unused-collector.h: Likewise.
* resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): Likewise.
(Early::resolve_rebind_import): Likewise.
(Early::visit): Likewise.
(Early::visit_derive_attribute): Likewise.
(Early::visit_non_builtin_attribute): Likewise.
(Early::finalize_simple_import): Likewise.
(Early::finalize_rebind_import): Likewise.
* resolve/rust-early-name-resolver-2.0.h: Likewise.
* resolve/rust-finalized-name-resolution-context.cc
(FinalizedNameResolutionContext::map_usage): Likewise.
(FinalizedNameResolutionContext::lookup): Likewise.
(FinalizedNameResolutionContext::to_canonical_path): Likewise.
* resolve/rust-finalized-name-resolution-context.h: Likewise.
* resolve/rust-forever-stack.h: Likewise.
* resolve/rust-late-name-resolver-2.0.cc (visit_identifier_as_pattern): Likewise.
(Late::visit): Likewise.
(Late::resolve_label): Likewise.
(resolve_type_path_like): Likewise.
* resolve/rust-name-resolution-context.cc
(CanonicalPathRecordCrateRoot::as_path): Likewise.
(CanonicalPathRecordNormal::as_path): Likewise.
(CanonicalPathRecordLookup::as_path): Likewise.
(CanonicalPathRecordImpl::as_path): Likewise.
(CanonicalPathRecordTraitImpl::as_path): Likewise.
(NameResolutionContext::map_usage): Likewise.
(NameResolutionContext::lookup): Likewise.
* resolve/rust-name-resolution-context.h: Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait): Likewise.
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
(TypeCheckExpr::resolve_fn_trait_call): Likewise.
* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise.
(TypeCheckExpr::resolve_root_path): Likewise.
(TypeCheckExpr::resolve_segments): Likewise.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Likewise.
(ResolveWhereClauseItem::visit): Likewise.
* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* backend/rust-compile-expr.h (CompileExpr::resolve_nodeid): Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
(CompileExpr::lookup_label): Likewise.
(CompileExpr::lookup_temp_var): Likewise.
(CompileExpr::resolve_NodeId): Likewise, and rename to...
(CompileExpr::resolve_nodeid): ...this.

6 weeks agogccrs: nr: Improve Macro Def/Invoc mappings
Arthur Cohen [Fri, 3 Apr 2026 15:16:14 +0000 (17:16 +0200)] 
gccrs: nr: Improve Macro Def/Invoc mappings

This now uses find_leaf_definition to better resolve macro definitions
to their actual definitions instead of a possible import, and likewise for
invocations. This also improves the robustness and error checking for
resolving definitions.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::insert_once): Rename...
(Early::try_insert_once): ...to this, and improve logic.
(Early::go): Use new API.
(Early::visit): Likewise.
(Early::finalize_simple_import): Likewise.
(Early::finalize_rebind_import): Likewise.
* resolve/rust-early-name-resolver-2.0.h: Declare the new API.

6 weeks agogccrs: session-manager: Call NRCtx::flatten after Late
Arthur Cohen [Wed, 25 Mar 2026 14:06:05 +0000 (15:06 +0100)] 
gccrs: session-manager: Call NRCtx::flatten after Late

Flatten the name resolution context after Late name resolution to make it more
useable for subsequent passes.

gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::compile_crate): Call nr_ctx.flatten()

6 weeks agogccrs: nr: Rename ImmutableNameResolutionContext to FinalizedNameResolutionContext.
Arthur Cohen [Wed, 25 Mar 2026 13:57:57 +0000 (14:57 +0100)] 
gccrs: nr: Rename ImmutableNameResolutionContext to FinalizedNameResolutionContext.

The ImmutableNRCtx was actually very mutable, as part of the pipeline needs to still map
usages later down the line deep within the backend and typecheckers. Instead, add a
new `map_usage` method which maps to the leafmost definition possible.

gcc/rust/ChangeLog:

* Make-lang.in: Rename.
* backend/rust-compile-base.cc: Use new name and API.
* backend/rust-compile-context.h: Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
(CompileExpr::generate_closure_function): Likewise.
* backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise.
* backend/rust-compile-item.cc (CompileItem::visit): Likewise.
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Likewise.
* checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Likewise.
* checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Likewise.
* checks/errors/privacy/rust-privacy-reporter.cc: Likewise.
* checks/errors/privacy/rust-privacy-reporter.h: Likewise.
* checks/errors/privacy/rust-visibility-resolver.cc: Likewise.
* checks/errors/privacy/rust-visibility-resolver.h: Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::PatternChecker): Likewise.
* checks/errors/rust-hir-pattern-analysis.h: Likewise.
* checks/errors/rust-readonly-check.cc (ReadonlyChecker::visit): Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Likewise.
(MarkLive::visit): Likewise.
(MarkLive::find_ref_node_id): Likewise.
* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::UnusedChecker): Likewise.
* checks/lints/unused/rust-unused-checker.h: Likewise.
* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::UnusedCollector): Likewise.
* checks/lints/unused/rust-unused-collector.h: Likewise.
* resolve/rust-immutable-name-resolution-context.cc: Move to...
* resolve/rust-finalized-name-resolution-context.cc: ...here.
* resolve/rust-name-resolution-context.h: Likewise.
* rust-session-manager.cc (Session::compile_crate): Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait): Likewise.
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
(TypeCheckExpr::resolve_fn_trait_call): Likewise.
* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise.
(TypeCheckExpr::resolve_root_path): Likewise.
(TypeCheckExpr::resolve_segments): Likewise.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Likewise.
(ResolveWhereClauseItem::visit): Likewise.
* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* checks/errors/rust-const-checker.h: Likewise.
* checks/errors/rust-unsafe-checker.h: Likewise.
* checks/lints/rust-lint-marklive.h: Likewise.
* resolve/rust-immutable-name-resolution-context.h: Removed.
* resolve/rust-finalized-name-resolution-context.h: New file.

6 weeks agogccrs: nr: Properly resolve imports and modules in segments
Arthur Cohen [Tue, 24 Mar 2026 13:34:15 +0000 (14:34 +0100)] 
gccrs: nr: Properly resolve imports and modules in segments

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_rebind_import): Insert imports
as possible glob containers.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::map_usage): Allow
multiple mappings of the same usage.
* resolve/rust-name-resolution-context.hxx: Properly handle imports and modules in segments.

gcc/testsuite/ChangeLog:

* rust/compile/import_in_type_ns6.rs: New test.
* rust/compile/import_in_type_ns7.rs: New test.

6 weeks agogccrs: nr: Finish moving all segment resolution methods to NRCtx
Arthur Cohen [Tue, 24 Mar 2026 12:57:56 +0000 (13:57 +0100)] 
gccrs: nr: Finish moving all segment resolution methods to NRCtx

gcc/rust/ChangeLog:

* resolve/rust-forever-stack.h: Move resolve_segments and resolve_final_segment to...
* resolve/rust-forever-stack.hxx: Likewise.
* resolve/rust-name-resolution-context.h: ...here.
* resolve/rust-name-resolution-context.hxx: Likewise.

6 weeks agogccrs: nr: Add imports to types NS, add NR flattening
Arthur Cohen [Tue, 24 Mar 2026 12:33:49 +0000 (13:33 +0100)] 
gccrs: nr: Add imports to types NS, add NR flattening

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc: Properly resolve and insert imports in the
types NS.
* resolve/rust-name-resolution-context.cc (find_leaf_definition_inner): New.
(NameResolutionContext::find_leaf_definition): New.
(NameResolutionContext::flatten): New.
* resolve/rust-name-resolution-context.h: Declare flattening functions.
* rust-session-manager.cc (Session::compile_crate): Call NR flattening.

6 weeks agogccrs: Make `extern crate self` resolve to current crate
Yap Zhi Heng [Tue, 2 Jun 2026 12:45:18 +0000 (20:45 +0800)] 
gccrs: Make `extern crate self` resolve to current crate

gcc/rust/ChangeLog:

* resolve/rust-default-resolver.h (DefaultResolver): Add new visited_crates
member for recursion protection.
* resolve/rust-default-resolver.cc (DefaultResolver::visit(ExternCrate)):
Make references of `self` resolve to the current crate.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
6 weeks agogccrs: lang: Add lang item exchange_malloc
Enes Cevik [Tue, 26 May 2026 12:07:10 +0000 (15:07 +0300)] 
gccrs: lang: Add lang item exchange_malloc

This patch introduces the `exchange_malloc` lang item to compiler.
This lang item is a strict prerequisite for the `owned_box` lang item
and box expressions.

gcc/rust/ChangeLog:

* util/rust-lang-item.cc (Rust::LangItem::lang_items): Register
exchange_malloc to BiMap.
* util/rust-lang-item.h (LangItem::Kind): Add EXCHANGE_MALLOC.

gcc/testsuite/ChangeLog:

* rust/compile/exchange_malloc.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 weeks agogccrs: Limit globbing visitor
Owen Avery [Tue, 2 Jun 2026 02:51:45 +0000 (22:51 -0400)] 
gccrs: Limit globbing visitor

The globbing visitor would previously descend into some kinds of rust
item, instead of registering them as glob imports or ignoring them. This
would cause items nested in those items to be glob imported, despite
them not being top level items inside the glob container.

gcc/rust/ChangeLog:

* resolve/rust-finalize-imports-2.0.cc (GlobbingVisitor::visit):
Add overrides for more items.
* resolve/rust-finalize-imports-2.0.h (GlobbingVisitor::visit):
Likewise.

gcc/testsuite/ChangeLog:

* rust/compile/name_resolution27.rs: New test.

Reported-by: Arthur Cohen <arthur.cohen@embecosm.com>
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
6 weeks agoc++/reflection: ^^ cannot define types [PR125922]
Marek Polacek [Wed, 24 Jun 2026 19:59:28 +0000 (15:59 -0400)] 
c++/reflection: ^^ cannot define types [PR125922]

The reflect-expression production uses "^^ type-id" which doesn't
allow defining types (it's not defining-type-id), but we aren't
checking this.

PR c++/125922

gcc/cp/ChangeLog:

* parser.cc (cp_parser_reflect_expression): Temporarily set
parser->type_definition_forbidden_message.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/error14.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
6 weeks agoc++: Add tests for C++29 P3847R1 - Lexical order for lambdas [PR125832]
Jakub Jelinek [Thu, 25 Jun 2026 17:11:32 +0000 (19:11 +0200)] 
c++: Add tests for C++29 P3847R1 - Lexical order for lambdas [PR125832]

I believe we already implement the P3847R1 - Lexical order for lambdas
paper, after all it is part of the ABI.
So, this patch just adds tests to verify that, so that we can mark this
as implemented (I'd say just Yes, even GCC 4.6 passes the second test
with -std=c++0x and GCC 4.8 with -std=c++1y the first test).

2026-06-25  Jakub Jelinek  <jakub@redhat.com>

PR c++/125832
* g++.dg/cpp29/lambda-order1.C: New test.
* g++.dg/cpp29/lambda-order2.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
6 weeks agoc++: Add tests for C++29 P3899R3 - Clarify the behavior of floating-point overflow...
Jakub Jelinek [Thu, 25 Jun 2026 16:15:00 +0000 (18:15 +0200)] 
c++: Add tests for C++29 P3899R3 - Clarify the behavior of floating-point overflow [PR125824]

As the P3899R3 paper says, it standardizes the GCC 15 behavior.

The following patch adds tests from the paper.
On the second test it seems to report the expected diagnostics
starting with PR104389 fix, so I think in cxx-status.html we should
say it is supported since GCC 12.  The first test obviously needs
at least GCC 13 because it uses the extended floating point types.

2026-06-25  Jakub Jelinek  <jakub@redhat.com>

PR c++/125824
* lib/target-supports.exp
(check_effective_target_flt_dbl_ldbl_inf_nan): New.
* g++.dg/cpp29/ext-floating1.C: New test.
* g++.dg/cpp29/std-floating1.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
6 weeks ago[RISC-V] Avoid multiply defined insn name
Jeff Law [Thu, 25 Jun 2026 15:37:13 +0000 (09:37 -0600)] 
[RISC-V] Avoid multiply defined insn name

When adding a ChangeLog entry for a recent change I realized the
define_insn_and_split didn't have a name.  So I added the name, but didn't
account for the iterator and thus we have the same name appearing multiple
times.

Anyway, this just adds the '*' prefix so that the name is considered for
debugging purposes only.

Pushing as obvious.

Jeff

ps.  Yes, you could argue that I should have written the ChangeLog when I wrote
the patch.

gcc/
* config/riscv/riscv.md (seq_sne_qi): Mark name for debugging purposes
only.

6 weeks agoObjective-C++: Parallelize the tests.
Iain Sandoe [Tue, 23 Jun 2026 09:53:18 +0000 (10:53 +0100)] 
Objective-C++: Parallelize the tests.

Although this is a small testsuite, waiting for it to complete
when debugging Objective-C issues is unproductive.  Keep the number
of parallel tests to 6, as per Objective-C.

gcc/objcp/ChangeLog:

* Make-lang.in: Test in parallel with up to 6 instances.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
6 weeks agoRISC-V: GLIBC's setjmp preserves callee-saved registers [PR87466]
Peter Bergner [Sat, 20 Jun 2026 02:42:31 +0000 (02:42 +0000)] 
RISC-V: GLIBC's setjmp preserves callee-saved registers [PR87466]

2026-06-19  Peter Bergner  <bergner@tenstorrent.com>

gcc/
PR target/87466
* config/riscv/riscv.cc (TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P):
Define.

Signed-off-by: Peter Bergner <bergner@tenstorrent.com>
6 weeks agors6000: Builtins for ECC cryptography instructions [RFC02669]
Manjunath S Matti [Wed, 24 Jun 2026 07:38:29 +0000 (02:38 -0500)] 
rs6000: Builtins for ECC cryptography instructions [RFC02669]

This patch implements builtin support for 21 new ECC (Elliptic Curve
Cryptography) acceleration instructions defined in RFC02669 for Power
future ISA. These instructions are designed to accelerate P-256 and
P-384 elliptic curve operations on POWER future processors. These
instructions may or may not be supported in a future processor. Note,
the names of the builtins may change in future.

The instructions are organized into five categories:

1. Multiply-Multiply operations (3 instructions):
   - xxmulmul: Multiply-multiply with scaling (scale values 0-6)
   - xxmulmulhiadd: Multiply-multiply with high add and accumulator
   - xxmulmulloadd: Multiply-multiply low add with accumulator

2. Scaled Multiply-Sum operations (3 instructions):
   - xxssumudm: Scaled sum unsigned doubleword modulo
   - xxssumudmc: Scaled sum unsigned doubleword modulo carry
   - xxssumudmcext: Extended version with separate accumulator
     (prefixed)

3. Quadword Add/Subtract operations (4 instructions):
   - xsaddadduqm: Add add unsigned quadword modulo
   - xsaddaddsuqm: Add add scaled unsigned quadword modulo
   - xsaddsubuqm: Add subtract unsigned quadword modulo
   - xsaddsubsuqm: Add subtract scaled unsigned quadword modulo

4. Merge operations (4 instructions):
   - xsmerge2t1uqm, xsmerge2t2uqm, xsmerge2t3uqm: 2-operand merge
   - xsmerge3t1uqm: 3-operand merge with accumulator

5. Rebase operations (7 instructions):
   - xsrebase2t1uqm through xsrebase2t4uqm: 2-operand rebase
   - xsrebase3t1uqm through xsrebase3t3uqm: 3-operand rebase with
     accumulator

All instructions operate on 128-bit unsigned integers
(vector unsigned __int128) and use VSX registers.
The xxssumudmcext instruction is a prefixed instruction (8 bytes),
while all others use the standard XX3 form (4 bytes).

2026-06-24  Manjunath Matti  <mmatti@linux.ibm.com>

gcc/ChangeLog:
* config/rs6000/predicates.md (const_0_to_6_operand): New predicate.
* config/rs6000/rs6000-builtins.def (__builtin_vsx_xxmulmul): Add new
builtin definitions under [future] stanza.
(__builtin_vsx_xxmulmulhiadd): Likewise.
(__builtin_vsx_xxmulmulloadd): Likewise.
(__builtin_vsx_xxssumudm): Likewise.
(__builtin_vsx_xxssumudmc): Likewise.
(__builtin_vsx_xxssumudmcext): Likewise.
(__builtin_vsx_xsaddadduqm): Likewise.
(__builtin_vsx_xsaddaddsuqm): Likewise.
(__builtin_vsx_xsaddsubuqm): Likewise.
(__builtin_vsx_xsaddsubsuqm): Likewise.
(__builtin_vsx_xsmerge2t1uqm): Likewise.
(__builtin_vsx_xsmerge2t2uqm): Likewise.
(__builtin_vsx_xsmerge2t3uqm): Likewise.
(__builtin_vsx_xsmerge3t1uqm): Likewise.
(__builtin_vsx_xsrebase2t1uqm): Likewise.
(__builtin_vsx_xsrebase2t2uqm): Likewise.
(__builtin_vsx_xsrebase2t3uqm): Likewise.
(__builtin_vsx_xsrebase2t4uqm): Likewise.
(__builtin_vsx_xsrebase3t1uqm): Likewise.
(__builtin_vsx_xsrebase3t2uqm): Likewise.
(__builtin_vsx_xsrebase3t3uqm): Likewise.
* config/rs6000/vsx.md (UNSPEC_XXMULMUL): Add UNSPEC entry.
(UNSPEC_XXMULMULHIADD): Likewise.
(UNSPEC_XXMULMULLOADD): Likewise.
(UNSPEC_XXSSUMUDM): Likewise.
(UNSPEC_XXSSUMUDMC): Likewise.
(UNSPEC_XXSSUMUDMCEXT): Likewise.
(UNSPEC_XSADDADDUQM): Likewise.
(UNSPEC_XSADDADDSUQM): Likewise.
(UNSPEC_XSADDSUBUQM): Likewise.
(UNSPEC_XSADDSUBSUQM): Likewise.
(UNSPEC_XSMERGE2T1UQM): Likewise.
(UNSPEC_XSMERGE2T2UQM): Likewise.
(UNSPEC_XSMERGE2T3UQM): Likewise.
(UNSPEC_XSMERGE3T1UQM): Likewise.
(UNSPEC_XSREBASE2T1UQM): Likewise.
(UNSPEC_XSREBASE2T2UQM): Likewise.
(UNSPEC_XSREBASE2T3UQM): Likewise.
(UNSPEC_XSREBASE2T4UQM): Likewise.
(UNSPEC_XSREBASE3T1UQM): Likewise.
(UNSPEC_XSREBASE3T2UQM): Likewise.
(UNSPEC_XSREBASE3T3UQM): Likewise.
(vsx_xxmulmul): New define_insn.
(vsx_xxmulmulhiadd): Likewise.
(vsx_xxmulmulloadd): Likewise.
(vsx_xxssumudm): Likewise.
(vsx_xxssumudmc): Likewise.
(vsx_xxssumudmcext): Likewise.
(vsx_xsaddadduqm): Likewise.
(vsx_xsaddaddsuqm): Likewise.
(vsx_xsaddsubuqm): Likewise.
(vsx_xsaddsubsuqm): Likewise.
(vsx_xsmerge2t1uqm): Likewise.
(vsx_xsmerge2t2uqm): Likewise.
(vsx_xsmerge2t3uqm): Likewise.
(vsx_xsmerge3t1uqm): Likewise.
(vsx_xsrebase2t1uqm): Likewise.
(vsx_xsrebase2t2uqm): Likewise.
(vsx_xsrebase2t3uqm): Likewise.
(vsx_xsrebase2t4uqm): Likewise.
(vsx_xsrebase3t1uqm): Likewise.
(vsx_xsrebase3t2uqm): Likewise.
(vsx_xsrebase3t3uqm): Likewise.
* doc/extend.texi (PowerPC AltiVec/VSX Built-in Functions): Add
documentation for ECC cryptography builtins available on
future ISA.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/ecc-builtin-1.c: New test for ECC builtins.

6 weeks ago[RISC-V][PR target/123884] Generate more Zbs instructions for RISC-V
Milan Tripkovic [Thu, 25 Jun 2026 13:34:14 +0000 (07:34 -0600)] 
[RISC-V][PR target/123884] Generate more Zbs instructions for RISC-V

So between Milan's work and my own realization earlier this week, we can
finally get resolution on pr123884 and pr106585.

The core issue is for what appear to be natural looking single bit
manipulations we often struggle to generate the bset, bclr or binv on riscv64.

A few items get in the way.  First, rv64 (of course) promotes sub-word objects
(ie ints) into word sized objects.  Second, we do have *some* instructions that
work on sub-objects (such as shifts which sign extend out to 64 bits).  Third,
a 32-bit object on rv64 is supposed to be sign extended out to 64 bits when it
"escapes" or gets used in a comparison.  Finally, the Zbs instructions do not
have forms which sign extend out to 64 bits if the SI sign bit is changed.

Consider this reduced fragment from x264:

int x264_macroblock_encode_p8x8(int dst, int a)
{
    dst &= ~(1 << a);
    return dst;
}

The code going into ext-dce looks like this:

> (insn 7 4 8 2 (set (reg:SI 141)
>         (const_int 1 [0x1])) "j.c":3:16 276 {*movsi_internal}
>      (nil))
> (insn 8 7 10 2 (set (reg:DI 142)
>         (sign_extend:DI (ashift:SI (reg:SI 141)
>                 (subreg:QI (reg/v:DI 138 [ a ]) 0)))) "j.c":3:16 312 {ashlsi3_extend}
>      (expr_list:REG_DEAD (reg:SI 141)
>         (expr_list:REG_DEAD (reg/v:DI 138 [ a ])
>             (expr_list:REG_EQUAL (sign_extend:DI (ashift:SI (const_int 1 [0x1])
>                         (subreg:QI (reg/v:DI 138 [ a ]) 0)))
>                 (nil)))))
> (insn 10 8 12 2 (set (reg:DI 143)
>         (not:DI (reg:DI 142))) "j.c":3:12 113 {one_cmpldi2}
>      (expr_list:REG_DEAD (reg:DI 142)
>         (nil)))
> (insn 12 10 13 2 (set (reg:DI 145)
>         (and:DI (reg/v:DI 137 [ dst ])
>             (reg:DI 143))) "j.c":3:9 104 {*anddi3}
>      (expr_list:REG_DEAD (reg:DI 143)
>         (expr_list:REG_DEAD (reg/v:DI 137 [ dst ])
>             (nil))))
> (insn 13 12 18 2 (set (reg:DI 146)
>         (sign_extend:DI (subreg:SI (reg:DI 145) 0))) "j.c":4:12 discrim 1 125 {*extendsidi2_internal}
>      (expr_list:REG_DEAD (reg:DI 145)
>         (nil)))
That'll end up generating something like:

>         li      a5,1            # 7  [c=4 l=4]  *movsi_internal/1
>         sllw    a1,a5,a1        # 8     [c=8 l=4] ashlsi3_extend
>         not     a1,a1   # 10    [c=4 l=4]  one_cmpldi2
>         and     a0,a0,a1        # 18    [c=4 l=4]  *anddi3/0

That seems almost tailor made for bclr.  Except for the possibility that we're
clearing bit 31.  THe RTL above would clear bits 31..63.  bclr just clears one
bit.

ext-dce comes along and realizes that insn 13 is redundant and removes it.  But
we still have the problem that the RTL would clear bits 31..63 if shift count
in (reg:DI 138) is 31 and thus trying to combine the result and generate a bclr
is wrong.

We had the idea that we could follow the bclr with a sign extension.  That
works for this testcase, but is wrong in general.

The insight from earlier this week is the semantics of bclr+sext work when
(reg:DI 137) has 33 or more sign bit copies.  In that limited, but common, case
the semantics of bclr+sext match the RTL exactly.  Just as important the output
is 2 insns, so we can model it as a simple define_split rather than a
define_insn_and_split.

So I've adjusted Milan's patch to check the number of sign bit copies in the
object where we want to clear a single bit.  If the number of sign bit copies
is 33 or more, then we allow the splitter to trigger.  The net is we get:

>         bclr    a0,a0,a1        # 10 [c=4 l=4]  *bclrdi
>         sext.w  a0,a0   # 18    [c=4 l=4] *extendsidi2_internal/0

The same idea works for bset and binv.

This has been bootstrapped and regression tested on both the c920 (where it
should do nothing, no Zbs extension) and the K3 (where I turn on Zbs by
default).  It's also been regression tested on riscv32-elf and riscv64-elf.
I'll obviously wait for pre-commit CI to run before moving forward.  But I
think we've finally got this issue nailed down.

PR target/123884
PR target/106585
gcc/
* config/riscv/bitmanip.md: Add new splits for single bit manipulation
cases followed by a sign extension.

gcc/testsuite
* gcc.target/riscv/pr123884-a.c: New test.
* gcc.target/riscv/pr123884-b.c: New test.
* gcc.target/riscv/pr123884-c.c: New test.

Co-authored-by: Jeff Law <jeffrey.law@oss.qualcomm.com>
6 weeks ago[RISC-V][PR target/124019] Add pattern to improve QI comparisons on RISC-V
Jeff Law [Thu, 25 Jun 2026 13:24:49 +0000 (07:24 -0600)] 
[RISC-V][PR target/124019] Add pattern to improve QI comparisons on RISC-V

So after much head-banging from Daniel and myself I think it's time to
acknowledge this issue isn't great for solving in match.pd.

Depending on the target's properties it may be advantageous to handle
generating code for this kind of idiom in different ways:

It may be better to mask off the irrelevant bits first, then compare to an
adjusted constant.  It may also be better to do a simpler direct approach of
shifting, the comparing to the constant.  Worse yet, the desired approach may
vary for a given architecture depending on the type of the object (it's related
to what bits need to be masked off and the constant we have to generate).

While I was able to convince myself we could canonicalize in match.pd, then
recover the regressed cases with target work, it'd be a lot of target testing &
hacking.  The effort is likely equivalent to leaving match.pd alone and
adjusting the target patterns to generate good code for the poorly handled
cases.  ie, in both scenarios we're likely doing significant target work.

Some quick evaluation against 502.gcc showed this never shows up in that
benchmark. However, it does show up in a trunk bootstrap on RISC-V (given an
earlier version with a code generation bug triggered a bootstrap failure).
While it's far from wide coverage, I suspect if we were to do wider testing it
rarely hits.

So I'm taking the conservative approach here.  Leave match.pd alone, add a
pattern to the RISC-V port to capture this oddball case, then move on.

Regression tested on riscv32-elf and riscv64-elf and bootstrap and regression
tested on the c920 and K3 designs.  Waiting on pre-commit CI before moving
forward.

PR target/124019
gcc/

* config/riscv/riscv.md (seq_sne_qi): New define_insn_and_split.

gcc/testsuite

* gcc.target/riscv/pr124019.c: New test.

Co-authored-by: Daniel Barboza <daniel.barboza@oss.qualcomm.com>
6 weeks agolibstdc++: Remove trailing whitespace in acinclude.m4
Jonathan Wakely [Thu, 25 Jun 2026 11:23:54 +0000 (12:23 +0100)] 
libstdc++: Remove trailing whitespace in acinclude.m4

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_STDIO_LOCKING): Remove trailing
whitespace.

6 weeks agolibstdc++: Update AC_FOREACH to m4_foreach_w [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AC_FOREACH to m4_foreach_w [PR103459]

AC_FOREACH has been deprecated by Autoconf.  Update to
m4_foreach_w.  No changes to generated files.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* configure.ac: Update AC_FOREACH to m4_foreach_w.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
6 weeks agolibstdc++: Update AM_PROG_LIBTOOL to LT_INIT [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AM_PROG_LIBTOOL to LT_INIT [PR103459]

AM_PROG_LIBTOOL has been deprecated by libtool. Update to LT_INIT.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* configure: Regenerate.
* configure.ac: Update AM_PROG_LIBTOOL to LT_INIT.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
6 weeks agolibstdc++: Update AC_LANG_{SAVE,RESTORE} to AC_LANG_{PUSH,POP} [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AC_LANG_{SAVE,RESTORE} to AC_LANG_{PUSH,POP} [PR103459]

AC_LANG_SAVE, AC_LANG_C, AC_LANG_CPLUSPLUS, and AC_LANG_RESTORE have
been deprecated by Autoconf.  Update with AC_LANG_PUSH and
AC_LANG_POP.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Replace
AC_LANG_SAVE AC_LANG_CPLUSPLUS (...) AC_LANG_RESTORE with
AC_LANG_PUSH([C++]) (...) AC_LANG_POP([C++]).
(GLIBCXX_CHECK_SETRLIMIT): Likewise.
(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG): Likewise.
(GLIBCXX_CHECK_POLL): Likewise.
(GLIBCXX_CHECK_WRITEV): Likewise.
(GLIBCXX_CHECK_LFS): Likewise.
(GLIBCXX_ENABLE_C99): Likewise.
(GLIBCXX_ENABLE_LIBSTDCXX_TIME): Likewise.
(GLIBCXX_CHECK_GETTIMEOFDAY): Likewise.
(GLIBCXX_CHECK_C99_TR1): Likewise.
(GLIBCXX_CHECK_UCHAR_H): Likewise.
(GLIBCXX_CHECK_STDIO_PROTO): Likewise.
(GLIBCXX_CHECK_MATH11_PROTO): Likewise.
(GLIBCXX_ENABLE_FLOAT128): Likewise.
(GLIBCXX_ENABLE_WCHAR_T): Likewise.
(GLIBCXX_ENABLE_PCH): Likewise.
(GLIBCXX_ENABLE_ATOMIC_BUILTINS): Likewise.
(GLIBCXX_ENABLE_LOCK_POLICY): Likewise.
(GLIBCXX_CHECK_GTHREADS): Likewise.
(GLIBCXX_CHECK_GET_NPROCS): Likewise.
(GLIBCXX_CHECK_SC_NPROCESSORS_ONLN): Likewise.
(GLIBCXX_CHECK_SC_NPROC_ONLN): Likewise.
(GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP): Likewise.
(GLIBCXX_CHECK_PTHREAD_COND_CLOCKWAIT): Likewise.
(GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK): Likewise.
(GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK): Likewise.
(GLIBCXX_CHECK_SYSCTL_HW_NCPU): Likewise.
(GLIBCXX_CHECK_TMPNAM): Likewise.
(GLIBCXX_CHECK_SDT_H): Likewise.
(GLIBCXX_CHECK_FILESYSTEM_DEPS): Likewise.
(GLIBCXX_CHECK_GETENTROPY): Likewise.
(GLIBCXX_CHECK_ARC4RANDOM): Likewise.
(GLIBCXX_ENABLE_BACKTRACE): Likewise.
(GLIBCXX_STRUCT_TM_TM_ZONE): Likewise.
(GLIBCXX_CHECK_ALIGNAS_CACHELINE): Likewise.
(GLIBCXX_CHECK_INIT_PRIORITY): Likewise.
(GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES): Likewise.
(GLIBCXX_CHECK_TEXT_ENCODING): Likewise.
(GLIBCXX_CHECK_DEBUGGING): Likewise.
(GLIBCXX_CHECK_STDIO_LOCKING): Likewise.
* configure: Regenerate.
* crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Replace
AC_LANG_SAVE AC_LANG_C with AC_LANG_PUSH([C]).
* linkage.m4 (GLIBCXX_CHECK_MATH_DECL_1): Replace
AC_LANG_SAVE AC_LANG_CPLUSPLUS (...) AC_LANG_RESTORE with
AC_LANG_PUSH([C++]) (...) AC_LANG_POP([C++]).
(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1) Likewise.
(GLIBCXX_CHECK_MATH_DECL_2): Likewise.
(GLIBCXX_CHECK_MATH_DECL_3): Likewise.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1): Likewise.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2): Likewise.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3): Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
6 weeks agolibstdc++: Update AC_TRY_COMPILE to AC_COMPILE_IFELSE [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AC_TRY_COMPILE to AC_COMPILE_IFELSE [PR103459]

AC_TRY_COMPILE has been deprecated by Autoconf.  Update to
AC_COMPILE_IFELSE.  Delete unused macro
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Update
AC_TRY_COMPILE to AC_COMPILE_IFELSE.
(GLIBCXX_CHECK_SETRLIMIT_ancilliary): Likewise.
(GLIBCXX_CHECK_SETRLIMIT): Likewise.
(GLIBCXX_ENABLE_C99): Likewise.
(GLIBCXX_ENABLE_LIBSTDCXX_TIME): Likewise.
(GLIBCXX_CHECK_C99_TR1): Likewise.
(GLIBCXX_CHECK_UCHAR_H): Likewise.
(GLIBCXX_ENABLE_CLOCALE): Likewise.
(GLIBCXX_ENABLE_WCHAR_T): Likewise.
(GLIBCXX_ENABLE_ATOMIC_BUILTINS): Likewise.
(GLIBCXX_ENABLE_LOCK_POLICY): Likewise.
(GLIBCXX_ENABLE_LIBSTDCXX_VISIBILITY): Likewise.
(GLIBCXX_ENABLE_SYMVERS): Likewise.
(GLIBCXX_CHECK_GTHREADS): Likewise.
(GLIBCXX_CHECK_X86_RDRAND): Likewise.
(GLIBCXX_CHECK_X86_RDSEED): Likewise.
(GLIBCXX_CHECK_SIZE_T_MANGLING): Likewise.
(GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Likewise.
(GLIBCXX_CHECK_ALIGNAS_CACHELINE): Likewise.
(GLIBCXX_CHECK_INIT_PRIORITY): Likewise.
(GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES): Likewise.
(GLIBCXX_CHECK_TEXT_ENCODING): Likewise.
(GLIBCXX_CHECK_DEBUGGING): Likewise.
(GLIBCXX_CHECK_STDIO_LOCKING): Likewise.
* configure: Regenerate.
* configure.ac: Update AC_TRY_COMPILE to AC_COMPILE_IFELSE.
* crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Likewise.
* linkage.m4 (GLIBCXX_CHECK_MATH_DECL_1): Likewise.
(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1): Likewise.
(GLIBCXX_CHECK_MATH_DECL_2): Likewise.
(GLIBCXX_CHECK_MATH_DECL_3): Likewise.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0): Delete.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1): Update
AC_TRY_COMPILE to AC_COMPILE_IFELSE.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2): Likewise.
(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3): Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
6 weeks agolibstdc++: Update AC_TRY_LINK to AC_LINK_IFELSE [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AC_TRY_LINK to AC_LINK_IFELSE [PR103459]

AC_TRY_LINK has been deprecated by Autoconf.  Update to
AC_LINK_IFELSE.  No changes to generated files.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Update
AC_TRY_LINK to AC_LINK_IFELSE.
(GLIBCXX_ENABLE_LIBSTDCXX_TIME): Likewise.
(GLIBCXX_ENABLE_ATOMIC_BUILTINS): Likewise.
(GLIBCXX_ENABLE_BACKTRACE): Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
6 weeks agolibstdc++: Update AC_HELP_STRING to AS_HELP_STRING [PR103459]
Pietro Monteiro [Thu, 25 Jun 2026 12:29:18 +0000 (08:29 -0400)] 
libstdc++: Update AC_HELP_STRING to AS_HELP_STRING [PR103459]

AC_HELP_STRING has been deprecated by Autoconf.  Update to
AS_HELP_STRING.  No changes to generated files.

PR bootstrap/103459

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_EXPORT_INSTALL_INFO): Update
AC_HELP_STRING to AS_HELP_STRING.
(GLIBCXX_ENABLE): Likewise.
(GLIBCXX_ENABLE_CLOCALE): Likewise.
(GLIBCXX_ENABLE_HOSTED): Likewise.
(GLIBCXX_ENABLE_VERBOSE): Likewise.
(GLIBCXX_ENABLE_LOCK_POLICY): Likewise.
(GLIBCXX_EMERGENCY_EH_ALLOC): Likewise.
(GLIBCXX_ZONEINFO_DIR): Likewise.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>