]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 months agoa68: new test trimmer-12.a68
Jose E. Marchesi [Sun, 22 Feb 2026 21:22:42 +0000 (22:22 +0100)] 
a68: new test trimmer-12.a68

This new test makes sure that the bounds are adjusted while trimming
dimensions of multiples with implicit lower and implicit upper bounds.

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

* algol68/execute/trimmer-12.a68: New test.

3 months agoc++: Fix up recent regression in convert_nontype_argument for C++1[14] [PR124173]
Jakub Jelinek [Sun, 22 Feb 2026 21:09:13 +0000 (22:09 +0100)] 
c++: Fix up recent regression in convert_nontype_argument for C++1[14] [PR124173]

The following testcase is rejected since my recent convert_nontype_argument
change, but only in C++11/14 modes.
The problem is that C++17 says that all NTTPs should be converted constant
expressions, but C++11 only said that for integral and enumeration ones and
something that applied to the decltype(nullptr) case was
- a constant expression that evaluates to a null pointer value
The problem is that for NULLPTR_TYPE_P for C++11/14, we just never called
maybe_constant_value, so obviously just making sure it is integer_zerop and
without tf_error returning NULL_TREE otherwise changes behavior on valid
programs, we really need to constant evaluate it first.

The following patch fixes that.

I'm afraid I actually don't know what exactly C++14 specifies, whether I've
grabbed a pre-C++14 or post-C++14 draft, which looked like the C++17
wording.   So, if C++14 needs something different, we'll need a further
change, but this at least fixes the regression.

2026-02-22  Jakub Jelinek  <jakub@redhat.com>

PR c++/124173
* pt.cc (convert_nontype_argument): For C++11/C++14 handle
NULLPTR_TYPE_P non-type arguments like TYPE_PTR_P.

* g++.dg/cpp0x/pr124173.C: New test.

3 months agoc++: Fix up CWG 3123 expansion stmt handling once again [PR124184]
Jakub Jelinek [Sun, 22 Feb 2026 21:07:45 +0000 (22:07 +0100)] 
c++: Fix up CWG 3123 expansion stmt handling once again [PR124184]

Barry Revzin mentioned in private mail that we reject the following
testcase even when it should be accepted.
The problem is that I thought finish_call_expr with tf_none would
be just harmless, but it is not, it can result in errors while trying
to instantiate something else (e.g. the noexcept).
So, instead of doing finish_call_expr with tf_none and only if that
returns error_mark_node calling it again with tf_any_viable, the
following patch just calls it only with tf_any_viable immediately.

2026-02-22  Jakub Jelinek  <jakub@redhat.com>

PR c++/124184
* parser.cc (cp_perform_range_for_lookup): If tf_error is
missing, call finish_call_expr after perform_koenig_lookup
calls immediately with tf_any_viable instead of twice, once
with tf_none and then with tf_any_viable.
* pt.cc (finish_expansion_stmt): Remove unneeded parens.

* g++.dg/cpp26/expansion-stmt31.C: New test.

3 months agolibcpp: Fix ICE with directives-only and cpp_maybe_module_directive [PR124153]
Nathaniel Shead [Sat, 21 Feb 2026 11:32:25 +0000 (22:32 +1100)] 
libcpp: Fix ICE with directives-only and cpp_maybe_module_directive [PR124153]

When doing directives-only processing (-E -fdirectives-only, or -M) we
crash if we hit an unexpected CPP_PRAGMA_EOL because we 'know' we're in
a module directive but the in_deferred_pragma flag is no longer set.

Fixed by undoing the "finished a module directive" behaviour within
cpp_maybe_module_directive if we're bailing due to an ill-formed peeked
token.

PR c++/124153

libcpp/ChangeLog:

* lex.cc (cpp_maybe_module_directive): Set in_deferred_pragma
and eol when we see an unexpected CPP_PRAGMA_EOL.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
3 months agolibcpp: Fix reading from stdin with -fsearch-include-path [PR119756]
Nathaniel Shead [Sat, 21 Feb 2026 13:32:00 +0000 (00:32 +1100)] 
libcpp: Fix reading from stdin with -fsearch-include-path [PR119756]

When using -fsearch-include-path, we prepend the result of
search_path_head to the provided filenames, which for non-absolute paths
will return "./".  At this point, stdin is represented by the empty
string, and so prepending "./" confuses 'open_file'.  This patch fixes
the issue by treating stdin as-if it were an absolute path.

PR c++/119756

libcpp/ChangeLog:

* files.cc (search_path_head): Also treat empty string (stdin)
as an absolute path.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
3 months agodriver: Escape special characters in '-fdeps-{file,target}' [PR120974]
Nathaniel Shead [Sun, 22 Feb 2026 02:09:00 +0000 (13:09 +1100)] 
driver: Escape special characters in '-fdeps-{file,target}' [PR120974]

The driver uses the 'join' function to calculate the default output for
the -fdeps-file and -fdeps-target parameters from the parameter given to
-o (or the basename of the input file).  But if the path given to -o has
any whitespace in it this causes cc1plus to see arguments like

  "-o some file.o" "-fdeps-file=some" "file.ddi"

which breaks.  Fixed by adjusting the 'join' function to escape any
special characters in the result.

PR c++/120974

gcc/ChangeLog:

* gcc.cc (join_spec_func): Escape special characters.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
3 months agoc++/reflection: anon union member from splice [PR123642]
Valentyn Yukhymenko [Fri, 20 Feb 2026 16:31:36 +0000 (16:31 +0000)] 
c++/reflection: anon union member from splice [PR123642]

Fixes a bogus "'Cls::<unnamed union>' is not a base of 'const Cls'" error
when user tries to do a class member lookup using splice with reflection of
anon union member.

PR c++/123642

gcc/cp/ChangeLog:

* typeck.cc (finish_class_member_access_expr): Change context lookup
to handle anon union members.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/member4.C: Remove expected error.
* g++.dg/reflect/anon4.C: New test based on original bug report.

Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
3 months agoAda: Fix inaccurate documentation of Max_Tasks restriction
Eric Botcazou [Sun, 22 Feb 2026 10:44:34 +0000 (11:44 +0100)] 
Ada: Fix inaccurate documentation of Max_Tasks restriction

The restriction is implementation defined and only enforced at compile
time by GNAT, so Storage_Error is never raised at run time.

gcc/ada
PR ada/124192
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
(Max_Tasks): Adjust description.
* gnat_rm.texi: Regenerate.

3 months agoAda: Fix crash on call to null procedure as triggering statement of select
Eric Botcazou [Sun, 22 Feb 2026 10:23:35 +0000 (11:23 +0100)] 
Ada: Fix crash on call to null procedure as triggering statement of select

This is really a corner case, but it exposes a couple of small issues in
Analyze_Triggering_Alternative that are worth fixing: 1) the detection of
delay and entry call statements is not robust enough and 2) there is also
a thinko in the detection of procedure call statements.

gcc/ada/
PR ada/124179
* sem_ch9.adb (Analyze_Triggering_Alternative): Use more robust
test for delay and entry call statements and fix thinko in test
for procedure call statements.

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

3 months agoa68: fix trimmers with implicit lower and upper bounds
Jose E. Marchesi [Sun, 22 Feb 2026 00:49:32 +0000 (01:49 +0100)] 
a68: fix trimmers with implicit lower and upper bounds

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

* a68-low-units.cc (lower_subscript_for_trimmers): Do not crash
with trimmers with implicit lower and upper bounds.

gcc/testsuite/ChangeLog

* algol68/execute/trimmer-11.a68: New test.

3 months agoDaily bump.
GCC Administrator [Sun, 22 Feb 2026 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

3 months agoxtensa: constantsynth: Exclude the stack pointer
Takayuki 'January June' Suwa [Fri, 20 Feb 2026 12:17:15 +0000 (21:17 +0900)] 
xtensa: constantsynth: Exclude the stack pointer

When updating the value of the stack pointer through a sequence of instruc-
tions, only the last instruction in the sequence must modify the stack
pointer, because the stack pointer may be referenced by an interrupt or
other event during the sequence:

     /* example */
     register void *stack_ptr asm ("a1");
     void test(void) {
       stack_ptr = (void *)0x04000000;
     }

     ;; before (-O -mabi=call0)
     test:
      movi.n sp, 1 ;; An interrupt may occur
      slli sp, sp, 26 ;; between these instructions
      ret.n

This patch avoids this problem by excluding constant value assignments to
the stack pointer from 'constantsynth'.

     ;; after (-O -mabi=call0)
      .literal_position
      .literal .LC0, 67108864
     test:
      l32r sp, .LC0
      ret.n

gcc/ChangeLog:

* config/xtensa/xtensa.cc (constantsynth_pass1):
Add the case where the assignment destination is a stack pointer
to the exclusion criteria for processing.

3 months agoa68: couple more fixes for error formatting tags
Jose E. Marchesi [Sat, 21 Feb 2026 21:33:46 +0000 (22:33 +0100)] 
a68: couple more fixes for error formatting tags

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

* a68-parser-bottom-up.cc (reduce_formal_holes): Fix error format
tag.
* a68-parser-taxes.cc (test_firmly_related_ops_local): Likewise.
(already_declared_hidden): Likewise.

3 months agoa68: fix error format string in Archive_file::initilize_big_archive
Jose E. Marchesi [Sat, 21 Feb 2026 21:16:11 +0000 (22:16 +0100)] 
a68: fix error format string in Archive_file::initilize_big_archive

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

* a68-imports-archive.cc (Archive_file::initialize_big_archive):
Fix formatting tag in call to a68_error.

3 months agoa68: fix %%< and %%> marks in snprintf calls
Jose E. Marchesi [Sat, 21 Feb 2026 20:36:19 +0000 (21:36 +0100)] 
a68: fix %%< and %%> marks in snprintf calls

The function a68_mode_error_text computes a string that is then passed
to a68_error or a68_warning.  The later functions feed the resulting
string to the diagnostics machinery, which knows how to handle %< and
%>, but the *printf calls don't.  Therefore the %s have to be escaped
for %< and %> to be interpreted literally.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
* a68-moids-diagnostics.cc (a68_mode_error_text): Properly escape
%< and %> in snprintf calls.

3 months agolibatomic: Fix race condition in libatomic all-local
Jakub Jelinek [Sat, 21 Feb 2026 20:17:43 +0000 (21:17 +0100)] 
libatomic: Fix race condition in libatomic all-local

In the past few bootstraps/regtests, I got occassionally one random FAIL
in libgomp testsuite, and the log said in each of the cases something like
obj02/x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.log:/usr/bin/ld: error: /home/jakub/src/gcc/obj02/gcc/libatomic.so: file too short
obj02/x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.log:/usr/bin/ld: error: /home/jakub/src/gcc/obj02/gcc/libatomic.so: file too short
obj05/i686-pc-linux-gnu/libgomp/testsuite/libgomp.log:/home/jakub/src/gcc/obj05/gcc/libatomic.so: file not recognized: file format not recognized
obj05/i686-pc-linux-gnu/libgomp/testsuite/libgomp.log:/home/jakub/src/gcc/obj05/gcc/libatomic.so: file not recognized: file format not recognized

I think what happens is that make check in libgomp and make check
in libatomic directories happen concurrently and in libatomic
there is the check -> check_recursive -> check-am -> all-am -> all-local
chain of dependencies.  And all-local is like many other automake goals
.PHONY, so even when it depends on libatomic.la, it is reexecuted each time
and each time attempts to install libatomic*.{so,a}* again, which can race
with make check in other directories.

The following patch fixes it by just adding dependency for all-local
on stmp-libatomic file and only rule for that file dependent on libatomic.la
and performing the installation.  So, if libatomic.la is not relinked, nothing
is reinstalled.

2026-02-21  Jakub Jelinek  <jakub@redhat.com>

* Makefile.am (all-local): Depend on stmp-libatomic and otherwise
do nothing.
(stmp-libatomic): New goal, move all commands from all-local here plus
touch $@ at the end.
* Makefile.in: Regenerate.

3 months agoa68: make Algol 68 diagnostics to use pp_format tags
Jose E. Marchesi [Sat, 21 Feb 2026 13:53:55 +0000 (14:53 +0100)] 
a68: make Algol 68 diagnostics to use pp_format tags

This commit changes the Algol 68 front-end diagnostics so it uses
regular format strings as recognized as pp_format, instead of the
upper-letter tags inherited from Genie.

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

* a68-pretty-print.h: New file.
* a68.h: Mark prototypes of diagnostic functions with
ATTRIBUTE_A68_DIAG.
* a68-diagnostics.cc (diagnostic): Do not translate upper-case
tags and pass a copy of the va_list `args' to diagnostic_set_info.
Mark with ATTRIBUTE_A68_DIAG.
* a68-imports-archive.cc: Convert to use standard error format
tags.
* a68-parser-victal.cc: Likewise.
* a68-parser-top-down.cc: Likewise.
* a68-parser-taxes.cc: Likewise.
* a68-parser-scanner.cc: Likeise.
* a68-parser-moids-check.cc: Likewise.
* a68-parser-modes.cc: Likewise.
* a68-parser-extract.cc: Likewise.
* a68-parser-pragmat.cc: Likewise.
* a68-parser-scope.cc: Likewise.
* a68-parser-brackets.cc: Likewise.
* a68-parser-bottom-up.cc: LIkewise.
* a68-moids-diagnostics.cc: Likewise.
* a68-imports.cc: Likewise.

3 months agoa68: fix handling of & in C formal hole symbols
Jose E. Marchesi [Sat, 21 Feb 2026 16:12:24 +0000 (17:12 +0100)] 
a68: fix handling of & in C formal hole symbols

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

* a68-low.cc (a68_make_formal_hole_decl): Get a boolean indicating
whether the declaration is for the address of the given symbol.
* a68.h: Update prototype of a68_make_formal_hole_decl.
* a68-low-holes.cc (a68_wrap_formal_var_hole): Pass a boolean to
a68_make_formal_hole_decl indicating whether an address is
required.

3 months agoa68: implementation of L bits_pack in standard prelude
Jose E. Marchesi [Wed, 18 Feb 2026 00:23:27 +0000 (01:23 +0100)] 
a68: implementation of L bits_pack in standard prelude

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

* a68-parser-prelude.cc (stand_prelude): Remove definitions for
bitpacks.

gcc/testsuite/ChangeLog

* algol68/compile/warning-hidding-4.a68: Mention bitspack.

libga68/ChangeLog

* standard.a68.in ({L_}bits_pack): New procedures.

3 months agoa68: standard Algol 68 preludes in Algol 68
Jose E. Marchesi [Mon, 2 Feb 2026 00:53:29 +0000 (01:53 +0100)] 
a68: standard Algol 68 preludes in Algol 68

This big commit:

* Adds support to the FFI mechanism to map Algol 68 procedures
  returning strings to an equivalent C interface.

* Adds a new command-line option -fbuilding-libga68.

* Adds support for having modules in libga68 implicitly invoked in
  user-written programs and modules.

* Using the infrastructure agove, removes the compiler-generated glue
  to call the standard POSIX prelude shipped in libga68 to, instead, use
  the formal holes mechanism for FFI.

* Adds posix.a68 to libga68.

* Adds standard.a68 to libga68.

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

* a68-moids-misc.cc (a68_is_c_mode): Allow C formal holes for
routines yielding strings.
* a68-low-holes.cc (a68_wrap_formal_proc_hole): Support wrappers
that yield strings.
* a68.h: Remove a68_posix_* and a68_lower_posix* prototypes.
* a68-low-posix.cc: Remove.
* a68-imports.cc (a68_open_packet): Get argument filename.
* Make-lang.in (ALGOL68_OBJS): Remove algol68/a68-low-posix.o.
* a68-low-runtime.def: Remove POSIX_*.
* lang.opt (-fcheck): Add new undocumented option -fbuilding-libga68.
* a68-parser-prelude.cc (stand_transput): New function.
(posix_prelude): Remove hardcoded additions to the top-level
environment and use a68_extract_revelations instead.
* a68-parser-extract.cc (a68_extract_revelation): Renamed from
extract_revelation and made accessible externally.
* a68-low.cc (a68_make_formal_hole_decl): Remove unneeded check.
(lower_lude_decl): New function.
(lower_module_text): Add calls to preludes and postludes of
standard modules if not building libga68.
(a68_lower_particular_program): Likewise.
* a68-low-prelude.cc (a68_lower_posixargc): Remove.
(a68_lower_posixargv): Likewise.
(a68_lower_posixgetenv): Likewise.
(a68_lower_posixputchar): Likewise.
(a68_lower_posixputs): Likewise.
(a68_lower_posixfconnect): Likewise.
(a68_lower_posixfopen): Likewise.
(a68_lower_posixfcreate): Likewise.
(a68_lower_posixfclose): Likewise.
(a68_lower_posixfsize): Likewise.
(a68_lower_posixlseek): Likewise.
(a68_lower_posixseekcur): Likewise.
(a68_lower_posixseekend): Likewise.
(a68_lower_posixseekset): Likewise.
(a68_lower_posixstdinfiledes): Likewise.
(a68_lower_posixstdoutfiledes): Likewise.
(a68_lower_posixstderrfiledes): Likewise.
(a68_lower_posixfileodefault): Likewise.
(a68_lower_posixfileordwr): Likewise.
(a68_lower_posixfileordonly): Likewise.
(a68_lower_posixfileowronly): Likewise.
(a68_lower_posixfileotrunc): Likewise.
(a68_lower_posixerrno): Likewise.
(a68_lower_posixexit): Likewise.
(a68_lower_posixperror): Likewise.
(a68_lower_posixstrerror): Likewise.
(a68_lower_posixfputc): Likewise.
(a68_lower_posixfputs): Likewise.
(a68_lower_posixgetchar): Likewise.
(a68_lower_posixfgetc): Likewise.
(a68_lower_posixgets): Likewise.
(a68_lower_posixfgets): Likewise.

gcc/testsuite/ChangeLog

* lib/algol68.exp (algol68_init): Add -I options to
ALGOL68_UNDER_TEST so exports in libga68.{a,so} are found.
* algol68/compile/warning-hidding-6.a68: Likewise.
* algol68/compile/warning-hidding-5.a68: Use maxint instead of
getchar to trigger the warning.
* algol68/compile/error-nest-4.a68: Procedures yielding strings
are now on in C formal holes.

libga68/ChangeLog

* posix.a68: New file.
* standard.a68.in: Likewise.
* ga68-posix.c (_libga68_stdin): Define.
(_libga68_stdout): Likewise.
(_libga68_stderr): Likewise.
(_libga68_file_o_default): Likewise.
(_libga68_file_o_rdonly): Likewise.
(_libga68_file_o_rdwr): Likewise.
(_libga68_file_o_trunc): Likewise.
(_libga68_seek_cur): Likewise.
(_libga68_seek_end): Likewise.
(_libga68_seek_set): Likewise.
(_libga68_posixstrerror): Update interface to new way of returning
Algol 68 strings.
(_libga68_posixargv): Likewise.
(_libga68_posixfgets): Likewise.
(_libga68_posixgets): Likewise.
(_libga68_posixfopen): Use _libga68_file_o_default rather than FILE_O_DEFAULT.
(_libga68_posixfopen): Ditto for other FILE_O_* values.
* ga68.h: Update prototypes.
* Makefile.am (libga68_la_LIBADD): Add standard.lo.
(libga68_la_DEPENDENCIES): Likeise.
(.a68.o): Pass -fbuilding-libga68.
(.a68.lo): Likewise.
(standard.a68): New rule.
* Makefile.in: Regenerate.
* transput.a68.in: Add Emacs -*- mode: a68 -*- comment.

3 months agoa68: distinguish between NO_LOWERER and LOWERER_UNIMPL
Jose E. Marchesi [Thu, 19 Feb 2026 02:46:57 +0000 (03:46 +0100)] 
a68: distinguish between NO_LOWERER and LOWERER_UNIMPL

Until now all the identifiers interned in A68_STANDENV were lowered by
using an explicit lowering routine.  This is because the entirely of
the standard preludes were implemented by having the compiler generate
the corresponding code inline.  We have a check in place to determine
whether a lowerer has been installed for a given standard construct:
NO_LOWERER.  This is a lowerer routine that just prints a message and
ICEs.

We want to write part of the standard preludes in Algol 68.  To make
that possible this patch introduces a distinction between NO_LOWERER,
meaning the definition comes from Algol 68 code in the runtime library
and therefore does not use a lowering routine, and LOWERER_UNIMPL,
which means the definition uses a lowering routine but a proper one
has not been written yet.

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

* a68-types.h (NO_LOWERER): Redefine as NULL.
(LOWERER_UNIMPL): Define.
* a68-parser-prelude.cc (a68_idf): Use LOWERER_UNIMPL instead of
NO_LOWERER.
(a68_prio): Likewise.
(a68_op): Likewise.
* a68-low-units.cc (a68_lower_identifier): Do not assume
declarations in A68_STANDENV all have lowerers.
(a68_lower_formula): Likewise.
(a68_lower_monadic_formula): Likewise.

3 months agoa68: support for importing exports data from archives
Jose E. Marchesi [Wed, 18 Feb 2026 11:11:07 +0000 (12:11 +0100)] 
a68: support for importing exports data from archives

The compiler tries to find exports data for accessed modules by
trying, in order:

* Standalone files: FOO.m68
* Shared object:    libFOO.so
* Archives:         libFOO.a
* Object files:     FOO.o

This commit adds support for archives.  Most of the code is copied
from the go FrontEnd's gcc/go/import-archive.c.

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

* a68-imports.cc (a68_find_export_data): Make visible externally.
(a68_find_export_data): Try reading export data from an archive
file.
* a68.h: Adjust prototype of a68_find_export_data accordingly.
* a68-imports-archive.cc: New file.
* Make-lang.in (ALGOL68_OBJS): Build algol/a68-imports-archive.o.

3 months ago[PR rtl-optimization/123994] Bullet-proof RTL-SSA loop to determine insertion location
Jeff Law [Sat, 21 Feb 2026 18:49:11 +0000 (11:49 -0700)] 
[PR rtl-optimization/123994] Bullet-proof RTL-SSA loop to determine insertion location

As discussed in the PR, there's two things we want to do WRT this bug.

First, we want to bullet-proof this loop.  It's trying to find an insertion
point, but can run off the end of the insn chain in the process.  That's enough
to fix the regression and the purpose of this patch.

For gcc-17 Richard S. has a more invasive change which fixes the underlying
cause of walking off the end of the insn chain.  This patch has the potential
to trigger more combinations which in turn could trip over latent bugs, so we
agreed to defer that fix until the gcc-17 cycle out of an abundance of caution.

My fix has been bootstrapped and regression tested on x86.  Pushing to the
trunk.

PR rtl-optimization/123994
gcc/
* rtl-ssa/changes.cc (function_info::verify_insn_changes): Bullet
proof loop to not fault if we run off the end of the insn chain.

gcc/testsuite/
* gcc.dg/torture/pr123994.c: New test.

3 months ago[PR target/124147] Fix build failure with clang on RISC-V
Jeff Law [Sat, 21 Feb 2026 16:32:07 +0000 (09:32 -0700)] 
[PR target/124147] Fix build failure with clang on RISC-V

Trivial fix for a build failure using clang.  The argument here is a pointer,
not a location_t.

Pushed to the trunk as obvious.

PR target/124147
gcc/
* config/riscv/riscv.cc (riscv_same_function_versions): Use nullptr_t rather
than UNKNOWN_LOCATION for pointer argument.

3 months agoRevert "Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]"
Harald Anlauf [Sat, 21 Feb 2026 07:24:20 +0000 (08:24 +0100)] 
Revert "Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]"

This reverts commit 84ef4948609260266f365c63ce429476fd31262f.

3 months agoDaily bump.
GCC Administrator [Sat, 21 Feb 2026 00:16:26 +0000 (00:16 +0000)] 
Daily bump.

3 months agoAda: Fix finalization glitch for pools with subpools
Eric Botcazou [Fri, 20 Feb 2026 19:46:30 +0000 (20:46 +0100)] 
Ada: Fix finalization glitch for pools with subpools

Finalize_Pool calls Finalize_And_Deallocate on every subpool handle, but
the parameter is declared with In Out mode, so the call ends up writing
back the updated value into the node that was just deallocated.

gcc/ada/
* libgnat/s-stposu.adb (Finalize_Pool): Pass a local copy of the
handle in the call to Finalize_And_Deallocate.

3 months agoFortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]
Gonzalo Silvalde Blanco [Fri, 20 Feb 2026 19:30:55 +0000 (20:30 +0100)] 
Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]

The error message for an ambiguous pointer function assignment contained a
FIXME and an embedded newline that the diagnostics printer does not handle.
Split the single gfc_error call into a gfc_error for the main diagnostic
and an inform note for the F2008 explanation, wrapped in an
auto_diagnostic_group.

PR fortran/80012

gcc/fortran/ChangeLog:

* symbol.cc (gfc_add_procedure): Split error into gfc_error and
inform using auto_diagnostic_group.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Gonzalo Silvalde Blanco <gonzalo.silvalde@gmail.com>
3 months agoFortran: [PR123949] Fix PDT ICE with large KIND values.
Jerry DeLisle [Fri, 20 Feb 2026 00:59:16 +0000 (16:59 -0800)] 
Fortran: [PR123949] Fix PDT ICE with large KIND values.

Signed-off-by: Christopher Albert <albert@tugraz.at>
PR fortran/123949

gcc/fortran/ChangeLog:

* decl.cc (gfc_get_pdt_instance): Use full integer string encoding
for PDT instance naming rather than 32-bit extraction, which caused
ICEs for valid large KIND values.

gcc/testsuite/ChangeLog:

* gfortran.dg/pdt_85.f03: New test.
* gfortran.dg/pr123949.f90: New test.

3 months agoopenmp: Fix regression in libgomp.c++/target-6.C testcase [PR113436]
Kwok Cheung Yeung [Fri, 20 Feb 2026 16:07:45 +0000 (16:07 +0000)] 
openmp: Fix regression in libgomp.c++/target-6.C testcase [PR113436]

The fix for PR113436 introduced a regression causing the
libgomp.c++/target-6.C testcase to fail on some configurations.

This was caused by a change in how is_variable_sized is applied for variables
that are references in private clauses, causing the path that was intended for
variables that are variable-sized in themselves to be taken, instead of
that for referencing a variable-sized object.

2026-02-20  Kwok Cheung Yeung  <kcyeung@baylibre.com>

gcc/

PR middle-end/113436
* omp-low.cc (omp_lower_target):  Do not check for variable-length
variables in private clauses by reference when allocating memory.

gcc/testsuite/

PR middle-end/113436
* g++.dg/gomp/pr113436-2.C: New.

3 months agotree-optimization/124068 - fix missed AVX2 vectorization of shift
Richard Biener [Wed, 18 Feb 2026 12:46:38 +0000 (13:46 +0100)] 
tree-optimization/124068 - fix missed AVX2 vectorization of shift

The following fixes a regression in AVX2 vectorization because on
trunk we are now correctly determine we can shorten a shift operation
but we never really bothered to check we can implement the
resulting operation.  With the patch we now check this.  For shifts
and rotates we have the choice between vector-vector and vector-scalar
operations which in the end depends on whether we perform SLP or not
and how the shift operand matches up.  The patch heuristically
assumes that constant or external shifts can be handled by vector-scalar
operations.

As we were not checking for target support was to allow recursive matching
other patterns, the following still errors on that side in case the
original operation was not supported by the target or it is binary and
the 2nd operand is a constant.  This helps avoiding regressions in
gcc.dg/vect/vect-over-widen-13.c and gcc.dg/vect/vect-div-bitmask-1.c
and gcc.target/aarch64/sve2/div-by-bitmask_1.c where the operation in
question is integer division.

PR tree-optimization/124068
* tree-vect-patterns.cc (target_has_vecop_for_code): Move
earlier, add defaulted optab_subtype parameter.
(vect_recog_over_widening_pattern): Check that the target
supports the narrowed operation before committing to the
pattern.

* gcc.target/i386/vect-shift-1.c: New testcase.

3 months agoipa-cp: Also look at self-recursive ancestor jump functions (PR122856)
Martin Jambor [Fri, 20 Feb 2026 13:34:27 +0000 (14:34 +0100)] 
ipa-cp: Also look at self-recursive ancestor jump functions (PR122856)

PR 122856 shows that when looking at self recursive calls with
self-feeding jump functions, we did consider pass-through functions
but not ancestor functions with zero offsets.  This then leads to the
fact that constants which were collected from IPA-CP lattices were not
among those collected from available edges, triggering a verification
assert.

This patch fixes that by also detecting self-feeding ancestor jump
functions.

gcc/ChangeLog:

2026-02-06  Martin Jambor  <mjambor@suse.cz>

PR ipa/122856
* ipa-cp.cc (self_recursive_pass_through_p): Test jump function type first.
(self_recursive_ancestor_p): New function.
(find_scalar_values_for_callers_subset): Test also for self-recursive
ancestor jump functions.
(push_agg_values_for_index_from_edge): Likewise.

gcc/testsuite/ChangeLog:

2026-02-06  Martin Jambor  <mjambor@suse.cz>

PR ipa/122856
* g++.dg/ipa/pr122856.C: New test.

3 months agolibstdc++: Fix testsuite breakage in r16-7593-g39edc2aea24f9a
Jonathan Wakely [Fri, 20 Feb 2026 09:17:31 +0000 (09:17 +0000)] 
libstdc++: Fix testsuite breakage in r16-7593-g39edc2aea24f9a

Fix my broken r16-7593-g39edc2aea24f9a commit which was an incomplete
version of what I originally tested.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (v3-minimum-std): Remove second
and third args in favour of using globals.

3 months agofold/dse: Don't simplify/remove noreturn functions [PR121103]
Andrew Pinski [Mon, 2 Feb 2026 05:08:54 +0000 (21:08 -0800)] 
fold/dse: Don't simplify/remove noreturn functions [PR121103]

This fixes 2 related bugs. The user marks memmove as noreturn
so when we simplify the memmove to a memory load/store there
is no longer a statement that can alter the CFG and things go
down hill.
The same is true for removing the call in DSE.
So the fix is not to simplify/take into account the call from
gimple-fold and DSE.

changes since v1:
 * v2: Use gimple_call_ctrl_altering_p instead of flags.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/121103

gcc/ChangeLog:

* gimple-fold.cc (gimple_fold_call): Don't simplify
noreturn functions.
* tree-ssa-dse.cc (dse_optimize_stmt): Don't handle
calls to noreturn functions.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr121103-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agocobol: Update and expand DejaGNU test suite.
Robert Dubner [Fri, 20 Feb 2026 02:15:59 +0000 (21:15 -0500)] 
cobol: Update and expand DejaGNU test suite.

The cobol.dg/group2 tests are extracted from a list of autotest programs
that are not maintained in the gnu GCC repository.  They can be see at
/https://gitlab.cobolworx.com/COBOLworx/gcc-cobol.

Many of these tests have been refined in order to make them work
properly when the exec-charset is ASCII, EBCDIC, or UTF16.  The changes
to existing tests seen here largely reflect those changes.

The new files shown below are newly extracted from that same list of
tests.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/ALLOCATE_Rule_8_OPTION_INITIALIZE_with_figconst.cob: Updated.
* cobol.dg/group2/ALLOCATE_Rule_8_OPTION_INITIALIZE_with_figconst.out: Updated.
* cobol.dg/group2/ALPHABETIC-LOWER_test.cob: Updated.
* cobol.dg/group2/ALPHABETIC-UPPER_test.cob: Updated.
* cobol.dg/group2/ALPHABETIC_test.cob: Updated.
* cobol.dg/group2/Context_sensitive_words__1_.cob: Updated.
* cobol.dg/group2/DEBUG_Line.cob: Updated.
* cobol.dg/group2/DISPLAY__Sign_ASCII.cob: Updated.
* cobol.dg/group2/DISPLAY__Sign_ASCII.out: Updated.
* cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob: Updated.
* cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out: Updated.
* cobol.dg/group2/EC-BOUND-REF-MOD_checking_process_termination.cob: Updated.
* cobol.dg/group2/FUNCTION_BIGGER-POINTER.cob: Updated.
* cobol.dg/group2/FUNCTION_BYTE-LENGTH.cob: Updated.
* cobol.dg/group2/FUNCTION_BYTE-LENGTH.out: Updated.
* cobol.dg/group2/FUNCTION_CHAR.cob: Updated.
* cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob: Updated.
* cobol.dg/group2/FUNCTION_HEX-OF.cob: Updated.
* cobol.dg/group2/FUNCTION_HEX-OF.out: Updated.
* cobol.dg/group2/FUNCTION_ORD.cob: Updated.
* cobol.dg/group2/FUNCTION_ORD.out: Updated.
* cobol.dg/group2/FUNCTION_TEST-DAY-YYYYDDD__2_.cob: Updated.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_additional.cob: Updated.
* cobol.dg/group2/FUNCTION_as_CALL_parameter_BY_CONTENT.cob: Updated.
* cobol.dg/group2/Hexadecimal_literal.cob: Updated.
* cobol.dg/group2/INSPECT_CONVERTING_TO_figurative_constants.cob: Updated.
* cobol.dg/group2/INSPECT_CONVERTING_TO_figurative_constants.out: Updated.
* cobol.dg/group2/LENGTH_OF_omnibus.cob: Updated.
* cobol.dg/group2/Non-numeric_data_in_numeric_items__2_.cob: Updated.
* cobol.dg/group2/PACKED-DECIMAL_dump.cob: Updated.
* cobol.dg/group2/PACKED-DECIMAL_dump.out: Updated.
* cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob: Updated.
* cobol.dg/group2/Refmod_sources_are_figurative_constants.cob: Updated.
* cobol.dg/group2/Refmod_sources_are_figurative_constants.out: Updated.
* cobol.dg/group2/debugging_lines__not_active_.cob: Updated.
* cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out: Updated.
* cobol.dg/group2/floating-point_literals.out: Updated.
* cobol.dg/group2/37-digit_Initialization_of_fundamental_types.cob: New test.
* cobol.dg/group2/37-digit_Initialization_of_fundamental_types.out: New test.
* cobol.dg/group2/ACCEPT_FROM_ENVIRONMENT-NAME.cob: New test.
* cobol.dg/group2/ACCEPT_FROM_ENVIRONMENT-NAME.out: New test.
* cobol.dg/group2/ACCEPT_foo_FROM_COMMAND-LINE_1_.cob: New test.
* cobol.dg/group2/ADD_1_2_TO_3_GIVING_B.cob: New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___ASCII_.cob:
New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___ASCII_.out:
New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___EBCDIC_.cob:
New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___EBCDIC_.out:
New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9_Without_OPTION_INITIALIZE_With_-fdefaultbyte___UTF16_.cob:
New test.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9_Without_OPTION_INITIALIZE_With_-fdefaultbyte___UTF16_.out:
New test.
* cobol.dg/group2/ANY_LENGTH__7_.cob: New test.
* cobol.dg/group2/ANY_LENGTH__7_.out: New test.
* cobol.dg/group2/Assorted_SPECIAL-NAMES_CLASS.cob: New test.
* cobol.dg/group2/Assorted_SPECIAL-NAMES_CLASS.out: New test.
* cobol.dg/group2/BINARY_and_COMP-5.cob: New test.
* cobol.dg/group2/BINARY_and_COMP-5.out: New test.
* cobol.dg/group2/CDF2_-_DEFINE_FOO_AS_literal-1.cob: New test.
* cobol.dg/group2/CDF2_-_DEFINE_FOO_AS_literal-1.out: New test.
* cobol.dg/group2/CDF2_Trouble_with___IF__1_.cob: New test.
* cobol.dg/group2/CDF2_Trouble_with___IF__2_.cob: New test.
* cobol.dg/group2/CDF2_Trouble_with___IF__2_.out: New test.
* cobol.dg/group2/CDF4_.cob: New test.
* cobol.dg/group2/CDF4_.out: New test.
* cobol.dg/group2/CDF_Feature_.cob: New test.
* cobol.dg/group2/CDF_Feature_.out: New test.
* cobol.dg/group2/CDF_IS_NOT_DEFINED.cob: New test.
* cobol.dg/group2/CDF_IS_NOT_DEFINED.out: New test.
* cobol.dg/group2/CDF__1__IF____text_.cob: New test.
* cobol.dg/group2/CDF__1__IF____text_.out: New test.
* cobol.dg/group2/CDF__2__IF____number_.cob: New test.
* cobol.dg/group2/CDF__2__IF____number_.out: New test.
* cobol.dg/group2/CDF__3__ALL_NUMERIC_COMPARISONS.cob: New test.
* cobol.dg/group2/CDF__3__ALL_NUMERIC_COMPARISONS.out: New test.
* cobol.dg/group2/COMP-5_Sanity_Check_.cob: New test.
* cobol.dg/group2/Complex_HEX__VALUE_and_MOVE_-_ASCII_EBCDIC.cob: New test.
* cobol.dg/group2/Complex_HEX__VALUE_and_MOVE_-_ASCII_EBCDIC.out: New test.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__1_.cob: New test.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__1_.out: New test.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__2_.cob: New test.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__2_.out: New test.
* cobol.dg/group2/Default_Arithmetic__1_.cob: New test.
* cobol.dg/group2/Default_Arithmetic__1_.out: New test.
* cobol.dg/group2/ENTRY_statement.cob: New test.
* cobol.dg/group2/ENTRY_statement.out: New test.
* cobol.dg/group2/EVALUATE__A__OR__a_.cob: New test.
* cobol.dg/group2/EVALUATE__A__OR__a_.out: New test.
* cobol.dg/group2/EVALUATE_condition__1_.cob: New test.
* cobol.dg/group2/EVALUATE_condition__1_.out: New test.
* cobol.dg/group2/FIND-STRING__forward_.cob: New test.
* cobol.dg/group2/FIND-STRING__forward_.out: New test.
* cobol.dg/group2/FIND-STRING__reverse_.cob: New test.
* cobol.dg/group2/FIND-STRING__reverse_.out: New test.
* cobol.dg/group2/FIXED_FORMAT_data_in_cols_73_and_beyond.cob: New test.
* cobol.dg/group2/FIXED_FORMAT_data_in_cols_73_and_beyond.out: New test.
* cobol.dg/group2/FIXED_FORMAT_data_misplaced_asterisk.cob: New test.
* cobol.dg/group2/FUNCTION_CONVERT.cob: New test.
* cobol.dg/group2/FUNCTION_CONVERT.out: New test.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_REPLACING.cob: New test.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_REPLACING.out: New test.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_TALLYING.cob: New test.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_TALLYING.out: New test.
* cobol.dg/group2/Fundamental_INSPECT_REPLACING.cob: New test.
* cobol.dg/group2/Fundamental_INSPECT_REPLACING.out: New test.
* cobol.dg/group2/Fundamental_INSPECT_TALLYING.cob: New test.
* cobol.dg/group2/Fundamental_INSPECT_TALLYING.out: New test.
* cobol.dg/group2/INITIALIZE_OCCURS_with_SIGN_LEADING___TRAILING.cob: New test.
* cobol.dg/group2/INITIALIZE_OCCURS_with_SIGN_LEADING___TRAILING.out: New test.
* cobol.dg/group2/INITIALIZE_OCCURS_with_numeric_edited.cob: New test.
* cobol.dg/group2/INITIALIZE_complex_group__1_.cob: New test.
* cobol.dg/group2/INITIALIZE_complex_group__2_.cob: New test.
* cobol.dg/group2/INITIALIZE_complex_group__2_.out: New test.
* cobol.dg/group2/INITIALIZE_group_entry_with_OCCURS.cob: New test.
* cobol.dg/group2/INITIALIZE_of_EXTERNAL_data_items.cob: New test.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__ASCII_.cob: New test.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__ASCII_.out: New test.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__EBCDIC_.cob: New test.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__EBCDIC_.out: New test.
* cobol.dg/group2/INITIALIZE_with_FILLER.cob: New test.
* cobol.dg/group2/INITIALIZE_with_REDEFINES.cob: New test.
* cobol.dg/group2/INITIALIZE_with_reference_modification.cob: New test.
* cobol.dg/group2/Intrinsic_Function_ABS.cob: New test.
* cobol.dg/group2/Intrinsic_Function_ACOS.cob: New test.
* cobol.dg/group2/Intrinsic_Function_ANNUITY.cob: New test.
* cobol.dg/group2/Intrinsic_Function_DATE-YYYYMMDD.cob: New test.
* cobol.dg/group2/Intrinsic_Function_NUMVAL.cob: New test.
* cobol.dg/group2/Intrinsic_Function_NUMVAL.out: New test.
* cobol.dg/group2/Long_Division.cob: New test.
* cobol.dg/group2/Long_Division.out: New test.
* cobol.dg/group2/MOVE_X_000203_.cob: New test.
* cobol.dg/group2/MOVE_X_000203_.out: New test.
* cobol.dg/group2/MOVE_to_JUSTIFIED_items.cob: New test.
* cobol.dg/group2/MOVE_to_JUSTIFIED_items.out: New test.
* cobol.dg/group2/N-Queens_algorithm.cob: New test.
* cobol.dg/group2/N-Queens_algorithm.out: New test.
* cobol.dg/group2/Numeric_operations__6_.cob: New test.
* cobol.dg/group2/Numeric_operations__6_.out: New test.
* cobol.dg/group2/Preserve_collation_past_a_CALL.cob: New test.
* cobol.dg/group2/Preserve_collation_past_a_CALL.out: New test.
* cobol.dg/group2/RETURN-CODE_moving.cob: New test.
* cobol.dg/group2/RETURN-CODE_nested.cob: New test.
* cobol.dg/group2/SORT__table_sort__2___ASCII_.cob: New test.
* cobol.dg/group2/SORT__table_sort__2___ASCII_.out: New test.
* cobol.dg/group2/SORT__table_sort__2___EBCDIC_.cob: New test.
* cobol.dg/group2/SORT__table_sort__2___EBCDIC_.out: New test.
* cobol.dg/group2/Simple_DEBUG-ITEM.cob: New test.
* cobol.dg/group2/Simple_DEBUG-ITEM.out: New test.
* cobol.dg/group2/Simple_ENVIRONMENT-NAME_with_exception.cob: New test.
* cobol.dg/group2/Simple_ENVIRONMENT-NAME_with_exception.out: New test.
* cobol.dg/group2/UNSTRING_with_refmods.cob: New test.
* cobol.dg/group2/UNSTRING_with_refmods.out: New test.
* cobol.dg/group2/command-line.cob: New test.
* cobol.dg/group2/command-line.out: New test.
* cobol.dg/group2/floating-point_FORMAT_1.cob: New test.
* cobol.dg/group2/floating-point_FORMAT_1.out: New test.
* cobol.dg/group2/floating-point_FORMAT_2.cob: New test.
* cobol.dg/group2/floating-point_FORMAT_2.out: New test.
* cobol.dg/group2/procedure_division_using_by.cob: New test.
* cobol.dg/group2/repository.cob: New test.
* cobol.dg/group2/skipping_at_the_top.cob: New test.
* cobol.dg/group2/source-computer_object-computer_repository__2_.cob: New test.

4 months agoDaily bump.
GCC Administrator [Fri, 20 Feb 2026 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

4 months agoRegenerate .pot files
Joseph Myers [Thu, 19 Feb 2026 21:07:55 +0000 (21:07 +0000)] 
Regenerate .pot files

gcc/po/
* gcc.pot: Regenerate.

libcpp/po/
* cpplib.pot: Regenerate.

4 months agolibstdc++: Rework constant_wrapper assignments and increments
Tomasz Kamiński [Wed, 18 Feb 2026 09:38:04 +0000 (10:38 +0100)] 
libstdc++: Rework constant_wrapper assignments and increments

This implements LWG4383 with LWG4500, LWG4523 follow-up corrections.

This patch changes the constant_wrapper assignments operator (including
compounds), increment and decrement to apply directly to value. In
consequence the operators are only supported for types, for which above
operations can be applied on const value.

libstdc++-v3/ChangeLog:

* include/std/type_traits (_CWOperators::operator++)
(_CWOperators::operator--, _CWOperators::operator+=)
(_CWOperators::operator-=, _CWOperators::operator*=)
(_CWOperators::operator/=, _CWOperators::operator%=)
(_CWOperators::operator&=, _CWOperators::operator|=)
(_CWOperators::operator^=, _CWOperators::operator<<=)
(_CWOperators::operator>>=, constant_wrapper::operator=):
Adjust definitions to apply operator on value.
* testsuite/20_util/constant_wrapper/generic.cc:
Remove test_pseudo_mutator.
* testsuite/20_util/constant_wrapper/instantiate.cc:
Test that operators are not provided if wrapped type
do not support them, or provide mutable operators.

4 months agolibstdc++: Use global variables for default/max std in libstdc++.exp
Jonathan Wakely [Tue, 17 Feb 2026 12:48:51 +0000 (12:48 +0000)] 
libstdc++: Use global variables for default/max std in libstdc++.exp

This simplifies the v3-minimum-std procedure slightly, but the main
advantage is making v3_modules_std depend on v3_max_std so that we don't
have to update two separate variables when new effective targets such as
c++29 get added.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (v3_default_std, v3_max_std): New
global variables.
(v3-minimum-std): Use globals instead of arguments.
(v3_modules_std): Define in terms of $v3_max_std.
(v3-dg-runtest): Use globals instead of local variables. Adjust
call to v3-min-std.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agolibstdc++: Replace uses of "c++2a" effective target with "c++20"
Jonathan Wakely [Tue, 17 Feb 2026 12:46:09 +0000 (12:46 +0000)] 
libstdc++: Replace uses of "c++2a" effective target with "c++20"

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (v3-minimum-std): Remove special
case for c++2a and TODO comment.
* testsuite/20_util/is_pod/requirements/explicit_instantiation.cc:
Replace c++2a effective target with c++20.
* testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_pod/value.cc: Likewise.
* testsuite/20_util/reference_wrapper/result_type.cc: Likewise.
* testsuite/20_util/reference_wrapper/typedefs-2.cc: Likewise.
* testsuite/20_util/reference_wrapper/typedefs-3.cc: Likewise.
* testsuite/20_util/result_of/sfinae_friendly_1.cc: Likewise.
* testsuite/20_util/tuple/78939.cc: Likewise.
* testsuite/20_util/uses_allocator/69293_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
* testsuite/20_util/variable_templates_for_traits.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Likewise.
* testsuite/ext/malloc_allocator/variadic_construct.cc:
Likewise.
* testsuite/ext/new_allocator/variadic_construct.cc: Likewise.
* testsuite/libstdc++-prettyprinters/chrono.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx20.cc: Likewise.
* testsuite/std/ranges/iota/size.cc: Likewise.
* testsuite/tr1/3_function_objects/result_of.cc: Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agoFix typo in last change.
Jeff Law [Thu, 19 Feb 2026 14:09:27 +0000 (07:09 -0700)] 
Fix typo in last change.

gcc/testuite
* gcc.dg/torture/pr124108.c: Fix typo.

4 months ago[PR tree-optimization/124108] Verify type_has_mode_precision before reassociating...
jlaw [Thu, 19 Feb 2026 14:04:27 +0000 (07:04 -0700)] 
[PR tree-optimization/124108] Verify type_has_mode_precision before reassociating expressions

As Andrew noted in pr124108, the two patterns that reassociate expressions to
expose a rotate hidden by an embedded XOR need to check
type_has_mode_precision_p to avoid an ICE during gimple->RTL expansion.

This adds the necessary checks.  Bootstrapped and regression tested on x86.

PR tree-optimization/124108
gcc/
* match.pd (reassociating XOR to expose rotations): Check
type_has_mode_precision_p before simplifying.

gcc/testsuite/
* gcc.dg/torture/pr124108.c: New test.

4 months agoc++/reflection: introduce METAFN_KIND_ARG
Marek Polacek [Wed, 18 Feb 2026 20:03:35 +0000 (15:03 -0500)] 
c++/reflection: introduce METAFN_KIND_ARG

This is mostly cosmetic.  It had to be a macro because a constexpr fn
would need a metafn_info* parameter but that struct comes only after
the %{ %} section in the gperf file, and we can only have one such
section.

gcc/cp/ChangeLog:

* metafns.gperf: Define METAFN_KIND_ARG.
* metafns.h: Regenerate.
* reflect.cc (process_metafunction): Use METAFN_KIND_ARG.

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoFurther fix up effective-target 'no_fsanitize_address' check
Thomas Schwinge [Thu, 19 Feb 2026 10:29:42 +0000 (11:29 +0100)] 
Further fix up effective-target 'no_fsanitize_address' check

That got added with commit r11-4762-g65e82636bcdb72a878c2e53943e71b15dd9fb22d
"PR target/96307: Fix KASAN option checking", and already fixed up in
commit r12-3723-g6e6bf4cd21af39a7923bae007517ab43a4c3b36a
"Fix no_fsanitize_address effective target", but I just realized that on, for
example, standard x86_64-pc-linux-gnu, I'm unexpectedly seeing test cases
UNSUPPORTED, due to the effective-target 'no_fsanitize_address' check failing
with:

    Executing on host: [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/  fsanitize_address3454287.c    -fdiagnostics-plain-output  -fsanitize=address -Wno-complain-wrong-lang  -lm  -o fsanitize_address3454287.exe    (timeout = 300)
    spawn [...]
    /usr/bin/ld: cannot find libasan_preinit.o: No such file or directory
    /usr/bin/ld: cannot find -lasan: No such file or directory
    collect2: error: ld returned 1 exit status
    compiler exited with status 1

Notice no setup for paths to build-tree libsanitizer.  Need to use a proper
'asan.exp' file with 'asan_init'/'asan_finish' calls to set up linker paths,
etc. -- however, all test cases using effective-target 'no_fsanitize_address'
are compilation test cases, so let's just reflect that in the effective-target
'no_fsanitize_address' check.  With that, I then get the desired:

    -UNSUPPORTED: gcc.dg/pr91441.c
    +PASS: gcc.dg/pr91441.c (test for excess errors)

    -UNSUPPORTED: gcc.dg/pr96260.c
    +PASS: gcc.dg/pr96260.c (test for excess errors)

    -UNSUPPORTED: gcc.dg/pr96307.c
    +PASS: gcc.dg/pr96307.c (test for excess errors)

    -UNSUPPORTED: gcc.dg/uninit-pr93100.c
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 16)
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 26)
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 38)
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 48)
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 61)
    +PASS: gcc.dg/uninit-pr93100.c  (test for warnings, line 71)
    +PASS: gcc.dg/uninit-pr93100.c (test for excess errors)

    -UNSUPPORTED: g++.dg/warn/uninit-pr93100.C  -std=gnu++20
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 13)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 20)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 31)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 38)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 49)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20  (test for warnings, line 56)
    +PASS: g++.dg/warn/uninit-pr93100.C  -std=gnu++20 (test for excess errors)
    [Etc.]

    -UNSUPPORTED: g++.dg/warn/uninit-pr95825-1.C  -std=gnu++20
    +PASS: g++.dg/warn/uninit-pr95825-1.C  -std=gnu++20  (test for bogus messages, line 17)
    +PASS: g++.dg/warn/uninit-pr95825-1.C  -std=gnu++20 (test for excess errors)
    [Etc.]

    -UNSUPPORTED: gnat.dg/asan1.adb
    +PASS: gnat.dg/asan1.adb (test for excess errors)

..., while these remain UNSUPPORTED for targets that don't support
'-fsanitize=address'.

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_no_fsanitize_address): Check 'assembly'
instead of 'executable'.

4 months agoc++: Clarify convert_nontype_argument return value in function comment
Jakub Jelinek [Thu, 19 Feb 2026 11:32:24 +0000 (12:32 +0100)] 
c++: Clarify convert_nontype_argument return value in function comment

If tf_error is not set in COMPLAIN, whether NULL_TREE or error_mark_node
is returned doesn't matter.

2026-02-19  Jakub Jelinek  <jakub@redhat.com>

* pt.cc (convert_nontype_argument): Clarify return value in function
comment.

4 months agocprop_hardreg: Use delete_insn_and_edges instead of delete_insn: gcc.dg/pr116053...
Thomas Schwinge [Thu, 19 Feb 2026 10:58:39 +0000 (11:58 +0100)] 
cprop_hardreg: Use delete_insn_and_edges instead of delete_insn: gcc.dg/pr116053-1.c does 'dg-require-effective-target int128' [PR116053]

Small fix-up for commit r16-7574-g6f777c34c9f221a50d0fc22b70b1cf7dd1fd9101
"cprop_hardreg: Use delete_insn_and_edges instead of delete_insn [PR116053]",
where for certain GCC targets, we see:

    [...]gcc/testsuite/gcc.dg/pr116053-1.c:8:6: error: expected declaration specifiers or '...' before '__int128'

PR rtl-optimization/116053
gcc/testsuite/
* gcc.dg/pr116053-1.c: 'dg-require-effective-target int128'.

4 months agovect: Fix target conditions in pr104116 test cases [PR123195]
Avinash Jayakar [Thu, 19 Feb 2026 05:36:16 +0000 (11:06 +0530)] 
vect: Fix target conditions in pr104116 test cases [PR123195]

A missing space in the target conditions of the test cases for PR104116,
caused the tests to run on platforms where it was not intended to.

This patch adds those spaces to the conditions.

2026-02-19  Avinash Jayakar  <avinashd@linux.ibm.com>

gcc/testsuite/ChangeLog:
PR target/123195
* gcc.dg/vect/pr104116-ceil-div-2.c: Add space.
* gcc.dg/vect/pr104116-ceil-div-pow2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-div.c: Likewise.
* gcc.dg/vect/pr104116-ceil-mod-2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-mod-pow2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-mod.c: Likewise.
* gcc.dg/vect/pr104116-ceil-udiv-2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-udiv-pow2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-udiv.c: Likewise.
* gcc.dg/vect/pr104116-ceil-umod-2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-umod-pow2.c: Likewise.
* gcc.dg/vect/pr104116-ceil-umod.c: Likewise.
* gcc.dg/vect/pr104116-floor-div-2.c: Likewise.
* gcc.dg/vect/pr104116-floor-div-pow2.c: Likewise.
* gcc.dg/vect/pr104116-floor-div.c: Likewise.
* gcc.dg/vect/pr104116-floor-mod-2.c: Likewise.
* gcc.dg/vect/pr104116-floor-mod-pow2.c: Likewise.
* gcc.dg/vect/pr104116-floor-mod.c: Likewise.
* gcc.dg/vect/pr104116-round-div-2.c: Likewise.
* gcc.dg/vect/pr104116-round-div-pow2.c: Likewise.
* gcc.dg/vect/pr104116-round-div.c: Likewise.
* gcc.dg/vect/pr104116-round-mod-2.c: Likewise.
* gcc.dg/vect/pr104116-round-mod-pow2.c: Likewise.
* gcc.dg/vect/pr104116-round-mod.c: Likewise.
* gcc.dg/vect/pr104116-round-udiv-2.c: Likewise.
* gcc.dg/vect/pr104116-round-udiv-pow2.c: Likewise.
* gcc.dg/vect/pr104116-round-udiv.c: Likewise.
* gcc.dg/vect/pr104116-round-umod-2.c: Likewise.
* gcc.dg/vect/pr104116-round-umod-pow2.c: Likewise.
* gcc.dg/vect/pr104116-round-umod.c: Likewise.

4 months agocontrib/filter-clang-warnings.py: Ignore all .texi
Filip Kastl [Mon, 16 Feb 2026 08:57:14 +0000 (09:57 +0100)] 
contrib/filter-clang-warnings.py: Ignore all .texi

Compiling GCC with Clang doesn't only yield Clang's warnings but also
warnings about .texi documentation files.  In filter-clang-warnings.py
we blacklisted some .texi files.  Blacklist all of them.

contrib/ChangeLog:

* filter-clang-warnings.py: Filter out all warnings comming from
files with ".texi" in their name.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
4 months agoi386: Use IN_RANGE in avx_vpermilp_parallel
Jakub Jelinek [Thu, 19 Feb 2026 06:56:59 +0000 (07:56 +0100)] 
i386: Use IN_RANGE in avx_vpermilp_parallel

On Wed, Feb 18, 2026 at 10:00:38AM +0100, Uros Bizjak wrote:
> BTW: Maybe IN_RANGE should be used more in this function? IMO,
> "!IN_RANGE (ipar[i], 2,3)" is easier to comprehend.

This patch does that.

2026-02-19  Jakub Jelinek  <jakub@redhat.com>

* config/i386/i386.cc (avx_vpermilp_parallel): Use IN_RANGE
macro.

4 months agoc++: Fix up convert_nontype_argument [PR124070]
Jakub Jelinek [Thu, 19 Feb 2026 06:55:38 +0000 (07:55 +0100)] 
c++: Fix up convert_nontype_argument [PR124070]

Some of the following testcases are incorrectly accepted.
The problem is in convert_nontype_argument.  It just does
maybe_constant_value earlier.  Later on for integral/enum/floating
point args it uses cxx_constant_value for complain & tf_error if
not val_dep_p and expr is not a simple constant, similarly for
class type it calls
      /* Replace the argument with a reference to the corresponding template
         parameter object.  */
      if (!val_dep_p)
        expr = create_template_parm_object (expr, complain);
      if (expr == error_mark_node)
        return NULL_TREE;
etc.  But for NULLPTR_TYPE_P and REFLECTION_TYPE_P cases (I bet
Marek has based the latter on the former) it only verifies the type
and not the actual expression.
I think we need to do that, because if maybe_constant_value fails, it
just returns the passed in argument and if nothing checks it, we accept
whatever was there (and sometimes ICE later).

The following patch implements that.

2026-02-19  Jakub Jelinek  <jakub@redhat.com>

PR c++/124070
* pt.cc (convert_nontype_argument): For NULLPTR_TYPE_P case
if expr is not integer_zerop and is not val_dep_p try harder,
for complain & tf_error use cxx_constant_value and return NULL_TREE
for error_mark_node, without tf_error return NULL_TREE.  Similarly
for REFLECTION_TYPE_P case if expr is not REFLECT_EXPR and is not
val_dep_p try harder like for NULLPTR_TYPE_P.

* g++.dg/cpp26/pr124070.C: New test.
* g++.dg/reflect/parameters_of4.C: Expect different diagnostics.
* g++.dg/reflect/define_aggregate7.C: New test.
* g++.dg/reflect/define_aggregate8.C: New test.

4 months ago++: Implement proposed CWG 3123 resolution
Jakub Jelinek [Thu, 19 Feb 2026 06:51:50 +0000 (07:51 +0100)] 
++: Implement proposed CWG 3123 resolution

On Wed, Feb 11, 2026 at 02:56:36AM +0200, Ville Voutilainen wrote:
> > Anyway, with the hope that CWG 3123 is voted in, this patch adds
> > a testcase for it.
>
> This was discussed some moments ago on the Core reflector, and it was
> pointed out that it's quite
> intentional in the proposed resolution of CWG 3123 that there's no
> overload resolution used for
> determining whether iteration is the chosen approach instead of
> destructuring, just a viability check.
> As far as I understand the code, finish_call_expr indeed does overload
> resolution.
>
> This additional testcase was provided: https://godbolt.org/z/o39hEs876
>
> In it, overload resolution fails due to an ambiguity, for iteration,
> and then destructuring is used instead. But the intent
> of the proposed resolution is that the semantics are (more) similar to
> what range-for uses, so the intent
> is that for iteration, only the presence of viable overloads is
> checked, and then iteration is committed to,
> and then the testcase should be rejected because the actual attempt to
> expand with iteration fails due to the aforementioned
> ambiguity.
>
> None of that affects this patch as such, but I think it's worth
> pointing out where this should eventually be going.

Ah, you're right.

We don't have any API to return whether there are any viable candidates.
I was looking into adding one, but realized that finish_call_expr
does way too many things before calling build_new_function_call
which does further stuff that
would also need to be duplicated before we can reach to splice_viable.

So, instead of duplicating all of that I've added tf_any_viable (using
an unused bit in tsubst_flags_t), which is then handled in
finish_call_expr, perform_overload_resolution and build_new_function_call
functions to return void_node instead of actually building any calls
if there are any viable candidates (and keep returning error_mark_node
if something earlier fails or there are no viable candidates)
and filtered out of complain flags for calls where it shouldn't be propagated.

The new testcase adds some extra new tests, e.g. struct with begin and
end non-static data members (my reading is that in that case E.begin
and E.end has been found, so we commit to iterating expansion stmt and
fail unless e.g. they whould have class type and usable operator ()).

2026-02-19  Jakub Jelinek  <jakub@redhat.com>

* cp-tree.h: Implement proposed CWG 3123 resolution.
(enum tsubst_flags): Add tf_any_viable enumerator.  Indent all
comments the same.
* call.cc (perform_overload_resolution): For tf_any_viable
return the first candidate instead of doing tourney.  Filter out
tf_any_viable flag from add_candidates call.
(build_new_function_call): For tf_any_viable return void_node
if any viable candidates are found rather than build_over_call.
Filter out tf_any_viable flag from resolve_args call.
* parser.cc (cp_perform_range_for_lookup): Pass COMPLAIN to
cp_range_for_member_function calls.  If not tf_error, for
successful ADL if one or both of finish_call_expr calls returns
error_mark_node, retry with tf_any_viable.  If both begin and
end expressions have a viable candidate or when member lookup
found both begin and end members, return NULL_TREE rather than
error_mark_node even when both *begin and *end are error_mark_node.
(cp_range_for_member_function): Add COMPLAIN argument, pass it
down to finish_class_member_access_expr and finish_call_expr.
* pt.cc (finish_expansion_stmt): Use esk_iterating if
cp_perform_range_for_lookup returned something other than
error_mark_node or if both begin_expr and end_expr are not
error_mark_node.
* semantics.cc (finish_call_expr): Filter out tf_any_viable
flag from all uses of complain except one build_new_function_call
call for the is_overloaded_fn case.

* g++.dg/cpp26/expansion-stmt29.C: New test.
* g++.dg/cpp26/expansion-stmt30.C: New test.

4 months agocobol: Improve generated code for fast_add and fast_subtract.
Robert Dubner [Thu, 19 Feb 2026 04:01:38 +0000 (23:01 -0500)] 
cobol: Improve generated code for fast_add and fast_subtract.

These changes improve the efficiency of generated code by recognizing
more instances where operations are on little-endian binary COBOL
variables and then avoiding calls to libgcobol.  The generated code
also reduces the number of intermediate variables created for that
little-endian arithmetic.

gcc/cobol/ChangeLog:

* genapi.cc (tree_type_from_field_type): Move static code.
(compare_binary_binary): Identify little-endian compares.
(psa_FldLiteralN): Eliminate obsolete development code; make the
initialized variables TREE_CONSTANT.
(parser_symbol_add): Adjust for modified FldLiteralN.
* genmath.cc (all_results_binary): Renamed. Modified for fastness.
(all_results_integer): Likewise.
(all_refers_integer): Likewise.
(largest_binary_term): Likewise.
(fast_add): Expand conditions.  Use get_binary_value_tree.
(fast_subtract): Likewise.
(fast_multiply): Expand conditions.
(fast_divide): Expand conditions.
(parser_add): Avoid fast_add when error or not-error are specified.
(parser_multiply): Likewise.
(parser_divide): Likewise.
(parser_subtract): Likewise.
* genutil.cc (tree_type_from_field): Disable; flagged for removal.
(get_binary_value): Use get_binary_value_tree.
(get_binary_value_tree): Avoid intermediate variables when possible.
(refer_is_clean): Formatting.
(is_pure_integer): Refine test for little-endian binary.
* genutil.h (get_binary_value_tree): New declaration.
(is_pure_integer): New declaration.
* symbols.cc (symbol_table_init): Explanatory ZEROS comment.

libgcobol/ChangeLog:

* gfileio.cc (__gg__file_reopen): Raise exception on failed OPEN
* gmath.cc (__gg__fixed_phase2_assign_to_c): Let pointer arithmetic
go negative.
(__gg__subtractf2_fixed_phase1): Edit a comment.

4 months agotestsuite: remove xfails from analyzer test [PR108400,PR124116]
David Malcolm [Thu, 19 Feb 2026 02:58:32 +0000 (21:58 -0500)] 
testsuite: remove xfails from analyzer test [PR108400,PR124116]

gcc/testsuite/ChangeLog:
PR analyzer/108400
PR analyzer/124116
* c-c++-common/analyzer/null-deref-pr108400-SoftEtherVPN-WebUi.c:
Remove xfails; these false positives appears to have been fixed by
r16-7365-g498fb8a24516b1.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoRISC-V: Add another combine pattern for vfmin/max on cost model
Pan Li [Tue, 17 Feb 2026 11:15:36 +0000 (19:15 +0800)] 
RISC-V: Add another combine pattern for vfmin/max on cost model

The recent change introduce another form of vfmin/max, which is
more "literal" compare the previous one.  The related vx_vf/vf*
test cases also failed due to this change.  Thus, add the pattern
to make the test case happy.

The below test suites are passed for this patch series.
* The rv64gcv fully regression test.
* Fix the vx_vf/vf* testcases.

gcc/ChangeLog:

* config/riscv/autovec-opt.md (*literal_v<ieee_fmaxmin_op>_vf_<mode>):
Add new pattern for vfmax/min combine to fx.

Signed-off-by: Pan Li <pan2.li@intel.com>
4 months agoFortran: Fix heap-use-after-free
Jerry DeLisle [Thu, 19 Feb 2026 00:19:26 +0000 (16:19 -0800)] 
Fortran: Fix heap-use-after-free

This fix stops freeing the current BLOCK namespace during malformed
END error recovery.  It now lets normal block unwinding/cleanup handle
the free, preventing the heap-use-after-free.

Suggested-by: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Christopher Albert <albert@tugraz.at>
PR fortran/122491

gcc/fortran/ChangeLog:

* decl.cc (gfc_match_end): Do not free current BLOCK namespace
during malformed END cleanup.

4 months agox86: Update gcc.target/i386/pr108938-3.c
H.J. Lu [Thu, 19 Feb 2026 00:03:35 +0000 (08:03 +0800)] 
x86: Update gcc.target/i386/pr108938-3.c

commit 4b71cafc8447e09ee41aff02acb5b26e8b112466
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Feb 17 11:43:43 2026 +0100

    bswap: Handle VEC_PACK_TRUNC_EXPR [PR120233]

compiles

void
foo2 (char* a, short* __restrict b)
{
  a[0] = b[0] >> 8;
  a[1] = b[0];
  a[2] = b[1] >> 8;
  a[3] = b[1];
}

into

movl (%rsi), %eax
bswap %eax
roll $16, %eax
movl %eax, (%rdi)
ret

instead of

movzwl (%rsi), %eax
movzwl 2(%rsi), %edx
movl %eax, %ecx
sall $16, %eax
sarw $8, %cx
movzwl %cx, %ecx
orl %ecx, %eax
movd %eax, %xmm0
movl %edx, %eax
sall $16, %edx
sarw $8, %ax
movdqa %xmm0, %xmm2
movzwl %ax, %eax
orl %eax, %edx
movd %edx, %xmm1
punpcklbw %xmm1, %xmm2
punpcklbw %xmm1, %xmm0
pshufd $65, %xmm2, %xmm2
punpcklbw %xmm2, %xmm0
movd %xmm0, (%rdi)
ret

Update gcc.target/i386/pr108938-3.c to also scan 3 bswaps for x86-64.

PR target/120233
* gcc.target/i386/pr108938-3.c: Also scan 3 bswaps for x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 months agoc++/reflection: add fixed test [PR123440]
Marek Polacek [Wed, 18 Feb 2026 20:53:01 +0000 (15:53 -0500)] 
c++/reflection: add fixed test [PR123440]

This test crashed until r16-7330.  The errors are expected.
Let's make sure the crash doesn't come back.

PR c++/123440

gcc/testsuite/ChangeLog:

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

4 months agocprop_hardreg: Use delete_insn_and_edges instead of delete_insn [PR116053]
Andrew Pinski [Wed, 18 Feb 2026 05:42:30 +0000 (21:42 -0800)] 
cprop_hardreg: Use delete_insn_and_edges instead of delete_insn [PR116053]

So delete_insn_and_edges was added explicitly to solve the problem of having
to cleanup the dead eh edges when a load becomes dead (non-trapping in this case).
This moves the one call to delete_insn in cprop_hardreg over to use delete_insn_and_edges
to fix this case.
Basically we copyprop the sp register into a memory load. This memory load is normally
dead way before but with non-call eh and -fno-delete-dead-exceptions, it is alive until
cprop_hardreg. After thie copy prop of the sp register into the memory address of the load,
the load becomes non-trapping and is allowed to be deleted. Except we don't remove the eh edges
because cprop_hardreg only called delete_insn. So this updates the call to delete_insn_and_edges
which removes the eh edges.

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

PR rtl-optimization/116053

gcc/ChangeLog:

* regcprop.cc (copyprop_hardreg_forward_1): Use delete_insn_and_edges
instead of delete_insn.

gcc/testsuite/ChangeLog:

* gcc.dg/pr116053-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months ago[PR120169, LRA]: Fix up REG_ARGS_SIZE note for output reloads
Vladimir N. Makarov [Wed, 18 Feb 2026 18:00:58 +0000 (13:00 -0500)] 
[PR120169, LRA]: Fix up REG_ARGS_SIZE note for output reloads

In this test case, LRA reloads arg push insn but does not move original
REG_ARGS_SIZE note to the reload insn which becomes a new arg push.  The
patch fixes it.

gcc/ChangeLog:

PR rtl-optimization/120169
* lra-int.h (lra_process_new_insns): Modify the prototype.
* lra.cc (lra_process_new_insns): Add arg fixup_reg_args_size with
implicit value.  Move REG_ARGS_SIZE note if necessary.
* lra-constraints.cc (curr_insn_transform): Pass the new arg value.

gcc/testsuite/ChangeLog:

PR rtl-optimization/120169
* gcc.target/m68k/pr120169.c: New.

4 months agoAMDGCN: Disable subdirectory configuration for unsupported GAS and LD
Maciej W. Rozycki [Wed, 18 Feb 2026 17:32:33 +0000 (17:32 +0000)] 
AMDGCN: Disable subdirectory configuration for unsupported GAS and LD

The `amdgcn' target is not supported by GAS or LD, so disable building
in the respective subdirectories, removing configuration errors such as:

This target is no longer supported in gas
make[1]: *** [Makefile:5473: configure-gas] Error 1

and:

*** ld does not support target amdgcn-unknown-none
*** see ld/configure.tgt for supported targets
make[1]: *** [Makefile:6968: configure-ld] Error 1

in builds where no explicit `--disable-gas' and `--disable-ld' options
have been used with the top-level `configure' script.  Users must not
have to disable features selected by default to get a working
configuration.

/
* configure.ac <amdgcn-*-*> (noconfigdirs): Add `ld' and `gas'.
* configure: Regenerate.

4 months agoc: Call relayout_decl in build_compound_literal when completing type [PR123365]
Jakub Jelinek [Wed, 18 Feb 2026 16:46:38 +0000 (17:46 +0100)] 
c: Call relayout_decl in build_compound_literal when completing type [PR123365]

Most other spots inthe C FE which change type of some VAR_DECL
through complete_array_type call relayout_decl to fix up DECL_MODE
etc., but build_compound_literal strangely does not.

It has layout_decl (decl, 0); call later on but I think that is
quite useless given that already the build_decl call earlier
calls that and so the second layout_decl probably does nothing
most of the time.

On the following testcase, the compound literal VAR_DECL has
BLKmode from the time it had incomplete array type and isn't
changed to DImode that the completed type has and asm stmt
expansion is unhappy about that.

Fixed thusly.

2026-02-18  Jakub Jelinek  <jakub@redhat.com>

PR c/123365
* c-decl.cc (build_compound_literal): Call relayout_decl
after completing the type.

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

4 months agolibstdc++: Add [[no_unique_address]] to repeat_view::_M_value [PR121402]
Patrick Palka [Wed, 18 Feb 2026 15:13:51 +0000 (10:13 -0500)] 
libstdc++: Add [[no_unique_address]] to repeat_view::_M_value [PR121402]

PR libstdc++/121402

libstdc++-v3/ChangeLog:

* include/std/ranges (repeat_view::_M_value): Add
[[no_unique_address]].
* testsuite/std/ranges/adaptors/sizeof.cc
[__cpp_lib_ranges_repeat]: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
4 months agotestsuite: arm: Use effective-target for aes-fuse-[12].c
Torbjörn SVENSSON [Tue, 17 Feb 2026 15:08:58 +0000 (16:08 +0100)] 
testsuite: arm: Use effective-target for aes-fuse-[12].c

gcc/testsuite/ChangeLog:

* gcc.target/arm/aes-fuse-1.c: Use effective-target
arm_cpu_cortex_a53.
* gcc.target/arm/aes-fuse-2.c: Likewise.
* lib/target-supports.exp: Define effective-target
arm_cpu_cortex_a53.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
4 months agotarget/123137 - improve TLS call placement validity check
Richard Biener [Wed, 18 Feb 2026 09:05:02 +0000 (10:05 +0100)] 
target/123137 - improve TLS call placement validity check

When we search for a point in an inseration candidate block that has
incoming live call clobbered regs we look for REG_DEAD notes of
those and indication of FLAGS reg becoming live.  But we consider
insns like

(insn 807 805 6 2 (parallel [
            (set (subreg:SI (reg:HI 509) 0)
                (lshiftrt:SI (reg:SI 514)
                    (const_int 16 [0x10])))
            (clobber (reg:CC 17 flags))
        ]) "/home/packages/tmp/onednn-3.9.1+ds/src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp":1891:25 1213 {*lshrsi3_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_DEAD (reg:SI 514)
            (nil))))

making the FLAGS_REG live despite the REG_UNUSED note or the setter
being a CLOBBER.  The following optimizes this by in turn honoring
REG_UNUSED for FLAGS_REG, pruning it immediately again.

This reduces required expensive iteration to other candidate BBs,
reducing compile-time for the testcase in the PR from hours to 6s.

PR target/123137
* config/i386/i386-features.cc (ix86_emit_tls_call): Improve
local FLAGS_REG liveness calculation.

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

4 months agoc++: bit_cast and consteval-only types [PR124096]
Marek Polacek [Fri, 13 Feb 2026 18:46:58 +0000 (13:46 -0500)] 
c++: bit_cast and consteval-only types [PR124096]

[bit.cast]/2: Mandates: Neither To nor From are consteval-only types

but we are not checking this, so the attached test compiled.  I'm
adding the check into cp_build_bit_cast rather than <bit> so that
we detect this even for __builtin_bit_cast.

PR c++/124096

gcc/cp/ChangeLog:

* semantics.cc (cp_build_bit_cast): Check that neither argument is
consteval-only.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jakub Jelinek <jakub@redhat.com>
4 months agovect: Fix vect-fncall-mask-math.c test
Victor Do Nascimento [Wed, 18 Feb 2026 09:40:53 +0000 (09:40 +0000)] 
vect: Fix vect-fncall-mask-math.c test

Given the release of relevant lmvec suport, the test's expected
failure is no longer satisfied as we are now able to emmit masked
calls to math functions, in this case expf.

We therefore change the xfail to a pass and, while at it, fix the
testism in the test, where temporary names had previously been
hardcoded.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-fncall-mask-math.c: Fix test.

4 months agoi386: Fix up avx_vpermilp_parallel [PR124138]
Jakub Jelinek [Wed, 18 Feb 2026 09:28:34 +0000 (10:28 +0100)] 
i386: Fix up avx_vpermilp_parallel [PR124138]

r16-3677 extended avx_vpermilp_parallel so that it handles also V8DImode
(among others) and broke this testcase.
For V8DFmode the bug existed there already since r0-127405 which extended
avx_vpermilp_parallel to handle V8DFmode.
For V16SImode/V16SFmode I think the code is correct, in that case it can
for V4SImode/V4SFmode choose any permutation it wants and the
V8S{I,F}mode and V16S{I,F}mode cases before FALLTHRU verify the upper lanes
match those lower ones.
For V[48]D[IF]mode the function uses different checking, where it checks
each pair of ipar separately:
    case E_V8DFmode:
    case E_V8DImode:
      /* In the 512-bit DFmode case, we can only move elements within
         a 128-bit lane.  First fill the second part of the mask,
         then fallthru.  */
      for (i = 4; i < 6; ++i)
        {
          if (ipar[i] < 4 || ipar[i] >= 6)
            return 0;
          mask |= (ipar[i] - 4) << i;
        }
      for (i = 6; i < 8; ++i)
        {
          if (ipar[i] < 6)
            return 0;
          mask |= (ipar[i] - 6) << i;
        }
      /* FALLTHRU */

    case E_V4DFmode:
    case E_V4DImode:
      /* In the 256-bit DFmode case, we can only move elements within
         a 128-bit lane.  */
      for (i = 0; i < 2; ++i)
        {
          if (ipar[i] >= 2)
            return 0;
          mask |= ipar[i] << i;
        }
      for (i = 2; i < 4; ++i)
        {
          if (ipar[i] < 2)
            return 0;
          mask |= (ipar[i] - 2) << i;
        }
      break;
so that it directly computes corresponding mask bit.
Earlier in the function it verified ipar[i] wasn't above
nelts (nor negative), so just checking if (ipar[i] >= 2) is ok, it can't
be negative, and just checking if (ipar[i] < 6) is also fine, because
it can never be 8 or above (because nelts is 8 in that case).
Though, the if (ipar[i] < 2) case check used to be correct only when
nelts could be only 4, when it can be 8 too, it will as in the following
testcase happily accept values in the [4, 7] range which shouldn't be
accepted (it can only handle [2, 3]).

Fixed thusly.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR target/124138
* config/i386/i386.cc (avx_vpermilp_parallel): Verify
ipar[2] and ipar[3] aren't larger than 3.

* gcc.dg/pr124138.c: New test.
* gcc.target/i386/avx512f-pr124138-1.c: New test.
* gcc.target/i386/avx512f-pr124138-2.c: New test.

4 months agoOpenMP/Fortran: Error for groupprivate + threadprivate
Tobias Burnus [Wed, 18 Feb 2026 09:05:39 +0000 (10:05 +0100)] 
OpenMP/Fortran: Error for groupprivate + threadprivate

As OpenMP spec issue 4663 has been voted on, replace warning by error when
mixing threadprivate with groupprivate.

gcc/fortran/ChangeLog:

* symbol.cc (gfc_check_conflict): Reject mixing OpenMP threadprivate
with groupprivate.
* trans-common.cc (build_common_decl): Remove warning when mixing
threadprivate with groupprivate.
* trans-decl.cc (add_attributes_to_decl): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/groupprivate-1.f90: Update test.
* gfortran.dg/gomp/groupprivate-4.f90: Likewise.
* gfortran.dg/gomp/groupprivate-6.f90: Likewise.
* gfortran.dg/gomp/groupprivate-7.f90: Extend test.

4 months agox86: Update stack alignment only if stack is used
H.J. Lu [Tue, 17 Feb 2026 01:51:58 +0000 (09:51 +0800)] 
x86: Update stack alignment only if stack is used

The same hard register may be used for both stack and non-stack accesses.
Update ix86_find_max_used_stack_alignment to adjust stack alignment only
when a hard register used for a stack access is defined in a basic block
that dominates the block where it is used.

gcc/

PR target/124098
* config/i386/i386.cc (ix86_access_stack_p): New.
(ix86_find_max_used_stack_alignment): Update stack alignment only
if stack is used.

gcc/testsuite/

PR target/124098
* gcc.target/i386/pr124098.c: New test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 months agoDaily bump.
GCC Administrator [Wed, 18 Feb 2026 00:16:35 +0000 (00:16 +0000)] 
Daily bump.

4 months agox86: Don't mark clobbered FLAGS_REG as live
H.J. Lu [Tue, 17 Feb 2026 05:45:09 +0000 (13:45 +0800)] 
x86: Don't mark clobbered FLAGS_REG as live

Don't mark clobbered FLAGS_REG as live in

(parallel [(set (reg:SI 119)
                (lshiftrt:SI (reg:SI 121)
                    (const_int 16 [0x10])))
           (clobber (reg:CC 17 flags))])

gcc/

PR target/124136
* config/i386/i386-features.cc (ix86_check_flags_reg): Don't
mark clobbered FLAGS_REG as live.

gcc/testsuite/

PR target/124136
* g++.target/i386/pr124136.C: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 months agoanalyzer: fix ICE due to sloppy types in unaryop_svalue [PR124104]
David Malcolm [Tue, 17 Feb 2026 23:04:17 +0000 (18:04 -0500)] 
analyzer: fix ICE due to sloppy types in unaryop_svalue [PR124104]

gcc/analyzer/ChangeLog:
PR analyzer/124104
* svalue.cc (unaryop_svalue::maybe_get_value_range): Bail out for
incompatible types.

gcc/testsuite/ChangeLog:
PR analyzer/124104
* c-c++-common/analyzer/casts-3.c: New test.
* gcc.dg/analyzer/ice-pr124104.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoanalyzer: fix ICE when throw-handling hits svalue complexity limit [PR124139]
David Malcolm [Tue, 17 Feb 2026 23:04:16 +0000 (18:04 -0500)] 
analyzer: fix ICE when throw-handling hits svalue complexity limit [PR124139]

gcc/analyzer/ChangeLog:
PR analyzer/124139
* engine.cc (exploded_node::on_throw): Bail out if we can't get
the fndecl for the call.

gcc/testsuite/ChangeLog:
PR analyzer/124139
* g++.dg/analyzer/exception-ice-pr124139.C: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoarm: don't allow movMcc when short-it but no vsel [PR124134]
Richard Earnshaw [Tue, 17 Feb 2026 16:19:32 +0000 (16:19 +0000)] 
arm: don't allow movMcc when short-it but no vsel [PR124134]

Perverse combinations of options can lead to the compiler having to
work around unexpected situations.  Armv8 originally specified that
complex IT sequences were deprecated for performance (it was later
rescinded).  If the options restrict the floating-point unit to
one without vsel, then movMcc patterns need complex IT sequences
and we can end up with unmatched RTL patterns.  Avoid this by
failing early when the target patterns are disabled.

gcc/ChangeLog:

PR target/124134
* config/arm/arm.md (movsfcc): FAIL if using restricted IT
blocks and we lack VSEL.
(movdfcc): Likewise.

gcc/testsuite/ChangeLog:

PR target/124134
* gcc.target/arm/pr124134.c: New test.

4 months agotestsuite: Add testcase for latent PR [PR123048]
Jakub Jelinek [Tue, 17 Feb 2026 16:44:04 +0000 (17:44 +0100)] 
testsuite: Add testcase for latent PR [PR123048]

This testcase started to be miscompiled with r16-4186 and went latent
again r16-6651.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/123048
* gcc.dg/pr123048.c: New test.

4 months agolibstdc++: Correct requirements for atomic/cons/zero_padding.cc tests again [PR124124]
Tomasz Kamiński [Tue, 17 Feb 2026 12:35:39 +0000 (13:35 +0100)] 
libstdc++: Correct requirements for atomic/cons/zero_padding.cc tests again [PR124124]

The requirements introduced in previous patch r16-7548-g060d7c2a9c1fe1,
were not sufficient for types of size bigger than 64B (Ctor or long double),
as dg-add-options of libatomic, links libatomic only if it is required to
handle atomics of 64B types or pointers.

This patch addresses above, by reducing the size of Ctor struct to fit in
64 bytes, and moving long double test to separate file, that requires and
links with libatomic.

PR libstdc++/124124

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/atomic/cons/zero_padding.cc: Updated
Ctor class and move test_floating to...
* testsuite/29_atomics/atomic_float/zero_padding.cc: Extracted
test_floating.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agoc++: void(concept-id) evaluation [PR121822]
Patrick Palka [Tue, 17 Feb 2026 16:21:45 +0000 (11:21 -0500)] 
c++: void(concept-id) evaluation [PR121822]

Similar to r16-7056-g22f51c0f5e62a4, here the expression within
the decltype void(Derived<T>) is non-dependent enough that we
instantiate/fold it immediately, during which however convert_to_void
tries to evaluate the concept-id, which fails.  When in an
unevaluated context such as decltype I don't think convert_to_void
should be evaluating concept-ids.

PR c++/121822

gcc/cp/ChangeLog:

* cvt.cc (convert_to_void): Don't evaluate a concept-id
in an unevaluated context.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoc++: unifying LAMBDA_EXPR [PR122318]
Patrick Palka [Tue, 17 Feb 2026 16:21:42 +0000 (11:21 -0500)] 
c++: unifying LAMBDA_EXPR [PR122318]

This patch makes the default case of unify accept LAMBDA_EXPR P/A pairs,
which we can legitimately hit during alias CTAD guide overload resolution.
We can also less legimitately hit this during partial specialization
matching (likely IFNDR).

I'm not totally sure if we want to handle them like any other non-deducible
expression vs handling them separately (returning success iff they're ==).
I couldn't come up with a testcase for which it mattered so I went the
simpler route.

PR c++/122318
PR c++/101670

gcc/cp/ChangeLog:

* pt.cc (unify) <default>: Accept LAMBDA_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-targ20.C: New test.
* g++.dg/cpp2a/lambda-targ21.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoc++: Implement __builtin_constexpr_diag (aka P2758 implementation)
Jakub Jelinek [Tue, 17 Feb 2026 14:56:59 +0000 (15:56 +0100)] 
c++: Implement __builtin_constexpr_diag (aka P2758 implementation)

I know P2758R5 didn't make it into C++26, but on IRC Ville said it would be
useful anyway, so here is a quick attempt at implementing it.

Not adding anything on the libstdc++ side, because I don't know where
experimental stuff like that should go, whether it would be in the
implementation namespace etc.

Tags are currently parsed and printed in the diagnostics, but -Wconstexpr-msg=
option and being able to #pragma GCC diagnostic ignore -Wconstexpr-msg=blah
will need to wait for GCC 17.

In any case, the compiler side is just one new builtin,
__builtin_constexpr_diag, whose first argument is 0 for print,
or 1 for warning or 2 for error (or that ored with 16 if location shouldn't
be caller's location but caller's caller location - useful when adding some
wrappers around the builtin), second argument is string_view of the tag
(or "" for no tag) and third argument is string_view or u8string_view
with the message.  The builtin also handles string literals.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

gcc/cp/
* cp-tree.h (enum cp_built_in_function): Add
CP_BUILT_IN_CONSTEXPR_DIAG.
(cexpr_str::cexpr_str): Add new default ctor.
(cexpr_str::type_check): Add optional allow_char8_t arg.
(cexpr_str::extract): Add optional ctx, non_constant_p, overflow_p
and jump_target arguments.
* cp-gimplify.cc (cp_gimplify_expr): Throw away
__builtin_constexpr_diag calls after gimplification of
their arguments.
* decl.cc (cxx_init_decl_processing): Create __builtin_constexpr_diag
FE builtin decl.
* constexpr.cc (call_stack, call_stack_tick, last_cx_error_tick):
Moved earlier.
(cxx_eval_constexpr_diag): New function.
(cxx_eval_builtin_function_call): Handle __builtin_constexpr_diag
calls.
* tree.cc (builtin_valid_in_constant_expr_p): Return true for
CP_BUILT_IN_CONSTEXPR_DIAG.
* semantics.cc (cexpr_str::type_check): Add allow_char8_t argument,
if true, allow data to return const char8_t *.
(cexpr_str::extract): Add ctx, non_constant_p, overflow_p and
jump_target arguments, if they are non-NULL, evalute expressions
in that context rather than using cxx_constant_value and translate
back to SOURCE_CHARSET even if message_data or message_sz are NULL.
gcc/testsuite/
* g++.dg/ext/constexpr-diag1.C: New test.
* g++.dg/ext/constexpr-diag2.C: New test.
* g++.dg/ext/constexpr-diag3.C: New test.
* g++.dg/ext/constexpr-diag4.C: New test.
* g++.dg/ext/constexpr-diag5.C: New test.
* g++.dg/ext/constexpr-diag6.C: New test.

4 months ago[RISC-V][PR target/124048] Fix RTL generated by conditional AND splitter
Jeff Law [Tue, 17 Feb 2026 14:45:57 +0000 (07:45 -0700)] 
[RISC-V][PR target/124048] Fix RTL generated by conditional AND splitter

The recently added patterns for recovering good code generation of conditional
operations on RISC-V with Zicond had a nasty little bug causing this bootstrap
failure.

The main patterns are fine -- in those cases the czero produces a neutral
value.  So for example a conditional IOR can use a czero to select between an
IOR's operand and zero, then we do an unconditional IOR of the common value and
the result of the czero.

For AND the neutral value is -1 rather than 0.  So we need a different
sequence.  We emit the AND into a temporary.  Then select between the common
term and zero.  Then IOR the temporary with the selected value.  That sequence
requires the tense of the selection to be inverted which I failed to do in the
split RTL output of the pattern.

Those had been tested by inspection only and the tense flip was missed.  Doko's
bootstrap test with zicond enabled by default was able to trip this problem.
Thankfully it was easy to reproduce and bisect and was mostly a matter of
waiting for builds to run.

I've bootstrapped this on one of my BPIs with B, V and Zicond enabled by
default.  I'll be pushing it to the trunk momentarily.  I never actually
compared assembly or debugged the resulting code, it was found purely by
inspection once I knew where to look.  ie, I don't have a testcase for the
testsuite, but this is covered by bootstrapping with Zicond enabled.

I'd been somewhat worried about this possibility for a while -- the B, V and
Zicond extensions are not well represented by CI systems for bootstrap testing.
Given the Pioneer here is still limping along, it's a good test of rv64gc and
I've hacked things up so that the BPI will enable B, V and Zicond by default.

The baseline run is still in progress (bootstrapping and regression testing on
the BPI is up to 30 hours now), but we'll have coverage going forward.
Obviously when the K3 systems come out the hope is this cycle time will drop
meaningfully.

PR target/124048
gcc/
* config/riscv/zicond.md (conditional AND patterns): Fix missed
flipping the condition's test in RTL output.

4 months agoTransition gfortran.dg/vect to dg-additional-sources
Richard Biener [Tue, 17 Feb 2026 14:08:54 +0000 (15:08 +0100)] 
Transition gfortran.dg/vect to dg-additional-sources

The following changes gfortran.dg/vect/vect.exp to glob all files
(catching unhandled mask-store-1.f90) and handling additional
flags via dg-additional-sources.

* gfortran.dg/vect/vect.exp: Remove special options
handling.  Glob all *.\[fF\]{,90,95,03,08} files.
* gfortran.dg/vect/O3-bb-slp-1.f: Add dg-additional-options.
* gfortran.dg/vect/O3-bb-slp-2.f: Likewise.
* gfortran.dg/vect/O3-pr36119.f90: Likewise.
* gfortran.dg/vect/O3-pr39595.f: Likewise.
* gfortran.dg/vect/O3-pr49957.f: Likewise.
* gfortran.dg/vect/Ofast-pr50414.f90: Likewise.
* gfortran.dg/vect/cost-model-pr34445.f: Likewise.
* gfortran.dg/vect/cost-model-pr34445a.f: Likewise.
* gfortran.dg/vect/fast-math-mgrid-resid.f: Likewise.
* gfortran.dg/vect/fast-math-pr33299.f90: Likewise.
* gfortran.dg/vect/fast-math-pr37021.f90: Likewise.
* gfortran.dg/vect/fast-math-pr38968.f90: Likewise.
* gfortran.dg/vect/fast-math-real8-pr40801.f90: Likewise.
* gfortran.dg/vect/fast-math-rnflow-trs2a2.f90: Likewise.
* gfortran.dg/vect/fast-math-vect-8.f90: Likewise.
* gfortran.dg/vect/no-fre-no-copy-prop-O3-pr51704.f90: Likewise.
* gfortran.dg/vect/no-vfa-pr32377.f90: Likewise.
* gfortran.dg/vect/no-vfa-pr32457.f90: Likewise.
* gfortran.dg/vect/mask-store-1.f90: Add missing dg-do.

4 months agotree-optimization/124130 - fixup noreturn calls during inlining
Richard Biener [Tue, 17 Feb 2026 10:42:44 +0000 (11:42 +0100)] 
tree-optimization/124130 - fixup noreturn calls during inlining

When we are altering the ctrl state of a stmt due to adding abnormal
edges from it we also have to make sure to cleanup its noreturn state.

PR tree-optimization/124130
* tree-inline.cc (copy_edges_for_bb): Fixup noreturn calls
with abnormal edge source.

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

4 months agotree-optimization/124132 - fix type problem in loop splitting
Richard Biener [Tue, 17 Feb 2026 10:05:45 +0000 (11:05 +0100)] 
tree-optimization/124132 - fix type problem in loop splitting

The following fixes the computation of the 2nd loop IV bound after
loop splitting when only one of the split IV and the loop control
variable is a pointer.

PR tree-optimization/124132
* tree-ssa-loop-split.cc (compute_new_first_bound): Fix
bound difference computation.

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

4 months agolibstdc++: Correct requirements for atomic/cons/zero_padding.cc tests [PR124124].
Tomasz Kamiński [Mon, 16 Feb 2026 14:07:54 +0000 (15:07 +0100)] 
libstdc++: Correct requirements for atomic/cons/zero_padding.cc tests [PR124124].

This test uses atomic<T>::compare_exchange_strong and thus may require
libatomic and atomic-cmpxchg-word. The requirement on thread-fence and
non_pch were superfulous.

PR libstdc++/124124

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/atomic/cons/zero_padding.cc: Adjust
dg-require.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agobswap: Handle VEC_PACK_TRUNC_EXPR [PR120233]
Jakub Jelinek [Tue, 17 Feb 2026 10:43:43 +0000 (11:43 +0100)] 
bswap: Handle VEC_PACK_TRUNC_EXPR [PR120233]

With r16-531 we've regressed
FAIL: gcc.target/i386/pr108938-3.c scan-assembler-times bswap[\t ]+ 3
on ia32 and also made 2 separate regressions in the same testcase
on x86_64-linux (which in scan-assembler-times cancel out; previously
we were generating one 64-bit bswap + rotate in one function and
one 32-bit bswap + rotate in another function, now we emit 2 32-bit bswaps
in the first one and really horrible code in the second one).

The following patch fixes the latter function by emitting 32-bit bswap
+ 32-bit rotate on both ia32 and x86_64.  This fixes the
above FAIL (and introduces
FAIL: gcc.target/i386/pr108938-3.c scan-assembler-times bswap[\t ]+ 2
on x86_64).

The problem is that the vectorizer now uses VEC_PACK_TRUNC_EXPR and
bswap/store_merging was only able to handle vectors in a CONSTRUCTOR.

The patch adds handling of VEC_PACK_TRUNC_EXPR if its operands are
CONSTRUCTORs.  Without a testcase, I wasn't confident enough to write
BYTES_BIG_ENDIAN support, for CONSTRUCTOR { A, B, C, D } we make
DCBA out of it on little endian but ABCD on big endian and that would
need to be combined with picking up the most significant halves of each
element.

I'll look incrementally at the other function.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR target/120233
* gimple-ssa-store-merging.cc (find_bswap_or_nop_2): New function.
(find_bswap_or_nop): Move CONSTRUCTOR handling to above function,
call it instead of find_bswap_or_nop_1.
(bswap_replace): Handle VEC_PACK_TRUNC_EXPR like CONSTRUCTOR.
(maybe_optimize_vector_constructor): Likewise.
(pass_optimize_bswap::execute): Likewise.
(get_status_for_store_merging): Likewise.
(pass_store_merging::execute): Likewise.

4 months agolibstdc++: Fix up submdspan std exports
Jakub Jelinek [Tue, 17 Feb 2026 10:37:52 +0000 (11:37 +0100)] 
libstdc++: Fix up submdspan std exports

On Mon, Feb 16, 2026 at 01:34:50PM +0100, Tomasz Kamiński wrote:
> This patch implements LWG 4491, addressing C++26 NB comments.
>
> libstdc++-v3/ChangeLog:
>
>       * include/std/mdspan (std::submdspan_extents): Rename to...
>       (std::subextents): Rename of submdspan_extents.
>       (std::submdspan_canonicalize_slices): Rename to...
>       (std::canonical_slices):

This broke
+FAIL: g++.dg/modules/compile-std1.C -std=c++26 (test for excess errors)
+FAIL: g++.dg/modules/compile-std1.C module-cmi std (gcm.cache/std.gcm)
+FAIL: g++.dg/modules/compile-std1.C module-cmi std.compat (gcm.cache/std.compat.gcm)
on all targets.

The following patch fixes it.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

* src/c++23/std.cc.in (std::submdspan_canonicalize_slices,
std::submdspan_extents): Remove exports.
(std::canonical_slices, std::subextents): New exports.

4 months agotestsuite: Require gas in gcc.dg/hierarchical-discriminator-loop-version.c etc. scans
Rainer Orth [Tue, 17 Feb 2026 09:39:42 +0000 (10:39 +0100)] 
testsuite: Require gas in gcc.dg/hierarchical-discriminator-loop-version.c etc. scans

The gcc.dg/hierarchical-discriminator-loop-version.c etc. tests FAIL on
Solaris with the native assembler:

FAIL: gcc.dg/hierarchical-discriminator-loop-version.c scan-assembler \\\\.loc 1 (9|10) [0-9]+ is_stmt 0 discriminator [0-9]+
FAIL: gcc.dg/hierarchical-discriminator-unroll.c scan-assembler \\\\.loc 1 17 7 is_stmt 0 discriminator ([1-9][0-9]*|0x[1-9a-fA-F][0-9a-fA-F]*)
FAIL: gcc.dg/hierarchical-discriminator-vect-version.c scan-assembler \\\\.loc 1 13 [0-9]+ is_stmt 0 discriminator ([1-9][0-9]*|0x[1-9a-fA-F][0-9a-fA-F]*)

When using Solaris as, the .loc directives aren't present.  Their use is
guarded by dwarf2out.cc (dwarf2out_default_as_loc_support), which
ultimately depends on HAVE_AS_DWARF2_DEBUG_LINE

To avoid this, this patch restricts the scans to gas targets, which is
better than what we currently have.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (as and gas),
and x86_64-pc-linux-gnu.

2026-02-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* gcc.dg/hierarchical-discriminator-loop-version.c
(scan-assembler): Require gas.
* gcc.dg/hierarchical-discriminator-unroll.c: Likewise.
* gcc.dg/hierarchical-discriminator-vect-version.c: Likewise.

4 months agotestsuite: Fix gcc.dg/asm-hard-reg-1.c on x86
Rainer Orth [Tue, 17 Feb 2026 09:00:40 +0000 (10:00 +0100)] 
testsuite: Fix gcc.dg/asm-hard-reg-1.c on x86

The gcc.dg/asm-hard-reg-1.c test FAILs on i386-pc-solaris2.11 and
i686-pc-linux-gnu with -m64:

FAIL: gcc.dg/asm-hard-reg-1.c scan-assembler-times foo\\t%ecx 4

It turns out the target selectors of the x86 scans are badly confused:

* Using an i?86-*-* target selector is always wrong given the existance of
  biarch i?86-*-* targets.  They should use the x86 effective target with
  ilp32 instead.

* dg directives don't heed the preprocessor, so scans were duplicated
  for i?86-*-* and x86-*-*, sometimes with different target selectors.

This patch simplifies and fixes the target selectors, removing
duplication.

Tested on i386-pc-solaris2.11 with -m32/-m64 and x86_64-pc-linux-gnu
with -m64/-m32/-mx32, and i686-pc-linux-gnu with -m32/-m64.

2026-02-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* gcc.dg/asm-hard-reg-1.c: Simplify x86 target selectors.  Remove
duplicates.

4 months agotestsuite: Compile gcc.dg/tree-ssa/ldexp.c with -std=c99
Rainer Orth [Tue, 17 Feb 2026 08:43:52 +0000 (09:43 +0100)] 
testsuite: Compile gcc.dg/tree-ssa/ldexp.c with -std=c99

The gcc.dg/tree-ssa/ldexp.c test FAILs on Solaris:

FAIL: gcc.dg/tree-ssa/ldexp.c (test for excess errors)
UNRESOLVED: gcc.dg/tree-ssa/ldexp.c scan-assembler-not \\tfmul\\t

Excess errors:
../builtins-config.h:53:2: error: #error forgot to set -std=c99.

Fixed by adding that option.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2026-02-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* gcc.dg/tree-ssa/ldexp.c (dg-additional-options): Add -std=c99.

4 months agoFixup types in gcc.dg/torture/ssa-fre-7.c
Richard Biener [Tue, 17 Feb 2026 08:32:22 +0000 (09:32 +0100)] 
Fixup types in gcc.dg/torture/ssa-fre-7.c

The testcase was only partly updated to use __SIZETYPE__, the
following fixes the remains.

* gcc.dg/torture/ssa-fre-7.c: Properly use __SIZETYPE__
where required.

4 months agotestsuite: i386: xfail gcc.dg/ipa/pr122458.c without gas
Rainer Orth [Tue, 17 Feb 2026 08:32:17 +0000 (09:32 +0100)] 
testsuite: i386: xfail gcc.dg/ipa/pr122458.c without gas

The gcc.dg/ipa/pr122458.c test FAILs on Solaris with the native assembler:

FAIL: gcc.dg/ipa/pr122458.c (test for excess errors)

Excess errors:
Assembler: pr122458.c
        "/var/tmp//cctINwTd.s", line 4 : Illegal mnemonic
        Near line: "    .dc.a foo"
        "/var/tmp//cctINwTd.s", line 4 : Syntax error
        Near line: "    .dc.a foo"

Given that .dc.a is a gas extension, this patch xfail's the patch
without gas.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (as and gas),
and x86_64-pc-linux-gnu.

2026-02-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* gcc.dg/ipa/pr122458.c: xfail without gas.

4 months agoc++: Fix up is_type_alias2.C testcase for Solaris [PR124119]
Jakub Jelinek [Tue, 17 Feb 2026 08:00:08 +0000 (09:00 +0100)] 
c++: Fix up is_type_alias2.C testcase for Solaris [PR124119]

Given https://eel.is/c++draft/expr.reflect#5.1
we error on
typedef __SIZE_TYPE__ A;
namespace B {
  using ::A;
  typedef __SIZE_TYPE__ C;
}
using B::C;
constexpr auto a = ^^A;
constexpr auto b = ^^B::A;
constexpr auto c = ^^B::C;
constexpr auto d = ^^C;
on ^^B::A and ^^C (note, clang++ fork only errors on ^^B::A).
Now, whether size_t is
typedef __SIZE_TYPE__ size_t;
namespace std {
  using ::size_t;
}
or
namespace std {
  typedef __SIZE_TYPE__ size_t;
}
using std::size_t;
depends on the target and clearly is the latter on Solaris, so testing
whether ^^size_t is a type alias doesn't work there - it is found as
a using decl there.
So  the following patch stops testing it for size_t and tests yet another
user alias (a typedef is already tested - ^^T).

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR c++/124119
* g++.dg/reflect/is_type_alias2.C (W): New type alias.
Assert is_type_alias (^^W).  Don't assert is_type_alias (^^size_t).

4 months agoc++: Don't support auto{x} and auto(x) for C++ < 23 in SFINAE contexts [PR120685]
Jakub Jelinek [Tue, 17 Feb 2026 07:59:06 +0000 (08:59 +0100)] 
c++: Don't support auto{x} and auto(x) for C++ < 23 in SFINAE contexts [PR120685]

The following testcase ICEs in C++ 20 and older, because during
diagnostics dump_template_bindings attempts to tsubst with tf_none
something and we try to emit a pedwarn during that.
While the pedwarn could be just guarded with if (complain & tf_warning),
I thought we shouldn't support extensions for tf_none and should
instead return error_mark_node.

The following patch does that.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR c++/120685
* typeck2.cc (build_functional_cast_1): For C++23 auto(x)
without tf_warning or tf_error return error_mark_node instead of
emitting pedwarn and handling it.
* semantics.cc (finish_compound_literal): Similarly for C++26
auto{x}.

* g++.dg/cpp23/auto-fncast19.C: New test.

4 months agotestsuite: Fix up copy-prop-aggregate-return-1.c target selector
Jakub Jelinek [Tue, 17 Feb 2026 07:54:01 +0000 (08:54 +0100)] 
testsuite: Fix up copy-prop-aggregate-return-1.c target selector

The recent copy-prop-aggregate-return-1.c test change changed on i686-linux
testresults:
-FAIL: gcc.dg/tree-ssa/copy-prop-aggregate-return-1.c scan-tree-dump-times forwprop1 "after previous" 1
+ERROR: gcc.dg/tree-ssa/copy-prop-aggregate-return-1.c: error executing dg-final: syntax error in target selector "target !ia32"

The following patch fixes that.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

* gcc.dg/tree-ssa/copy-prop-aggregate-return-1.c: Fix up target
selector.

4 months agoc++: For reflection look through DECL_LOCAL_DECL_P decls and fix up has_default_argum...
Jakub Jelinek [Tue, 17 Feb 2026 07:37:34 +0000 (08:37 +0100)] 
c++: For reflection look through DECL_LOCAL_DECL_P decls and fix up has_default_argument [PR123612]

Based on discussions in the PR that C++ 26 reflection is
entity based rather than declaration based, the following patch
ensures we reflect DECL_LOCAL_DECL_ALIAS of DECL_LOCAL_DECL_P vars
or function decls.
Additionally, while default arguments are intentionally not merged
from the block scope externs to their corresponding namespace scope
function decls, for std::meta::has_default_argument the wording
requires to return true even if there is at least one block scope
extern with default argument for the particular parameter.
So, the patch also records in a new flag whether a default argument
has been present in a block scope extern and propagates it through
further duplicate_decls.  eval_has_default_arguments then uses
both this new flag (for the block scope externs) and the preexisting
search for default arguments in the corresponding type.

2026-02-17  Jakub Jelinek  <jakub@redhat.com>

PR c++/123612
* cp-tree.h (DECL_HAS_DEFAULT_ARGUMENT_P): Define.
* decl.cc (merge_decl_arguments): For -freflection and
extern_alias set DECL_HAS_DEFAULT_ARGUMENT_P (oldarg)
if newdecl has a default argument for that parameter,
otherwise propagate the flag.
* reflect.cc (get_reflection): For DECL_LOCAL_DECL_P
use its DECL_LOCAL_DECL_ALIAS.
(eval_has_default_argument): Return boolean_true_node
also if DECL_HAS_DEFAULT_ARGUMENT_P flag is set.

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

4 months agoc++: fix missing file:line:column on "required from here" [PR122001]
David Malcolm [Tue, 17 Feb 2026 02:55:55 +0000 (21:55 -0500)] 
c++: fix missing file:line:column on "required from here" [PR122001]

PR diagnostics/122001 notes that in GCC 15 we emit:

<source>: In instantiation of 'void foo(T) [with T = std::nullptr_t]':
<source>:7:8:   required from here
    7 |     foo(nullptr);
      |     ~~~^~~~~~~~~
<source>:3:7: error: invalid operands of types 'int' and 'std::nullptr_t' to binary 'operator+'
    3 |     1 + t;
      |     ~~^~~

whereas in GCC 16 we emit:

<source>: In instantiation of 'void foo(T) [with T = std::nullptr_t]':
required from here
<source>:7:8:
    7 |     foo(nullptr);
      |     ~~~^~~~~~~~~
<source>:3:7: error: invalid operands of types 'int' and 'std::nullptr_t' to binary 'operator+'
    3 |     1 + t;
      |     ~~^~~

where the "required from line" has lost its file:line:column prefix,
with the latter appearing on a follow line.

The root cause is that in r15-5995-g339246fb9ef4ca I changed
cp/error.cc's print_instantiation_partial_context_line from using
print_location to using auto_context_line, so that the location
information would be better integrated with nested diagnostics,
and enabled this by default in r16-3092-gd3fe5a560f0bcc.

text_sink::build_indent_prefix is returning the empty string for such
lines, rather than an indented bullet point.

This patch tweaks things so that such lines print the location before
the message at the top nesting level, and on a separate line at nested
nesting levels, and always the latter with
-fno-diagnostics-show-nesting.

gcc/cp/ChangeLog:
PR diagnostics/122001
* error.cc (auto_context_line::auto_context_line): Initialize
m_nesting_level and m_location_printed.  Update the condition
for printing location in ctor to also do it at top-level
nesting level.  Record into m_location_printed if we did
print the location.
(auto_context_line::~auto_context_line): Don't call print_location
if we already printed it in the ctor.
(auto_context_line::m_nesting_level): New field.
(auto_context_line::m_location_printed): New field.

gcc/testsuite/ChangeLog:
PR diagnostics/122001
* g++.dg/diagnostic/instantiation-context-pr122001-1.C: New test.
* g++.dg/diagnostic/instantiation-context-pr122001-2.C: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agotestsuite: fix analyzer failures seen after r16-3810 [PR121928]
David Malcolm [Tue, 17 Feb 2026 02:55:50 +0000 (21:55 -0500)] 
testsuite: fix analyzer failures seen after r16-3810 [PR121928]

gcc/testsuite/ChangeLog:
PR analyzer/121928
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers-default.C:
Add -Wno-analyzer-too-complex.
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers-no.C:
Likewise.
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers.C:
Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoDaily bump.
GCC Administrator [Tue, 17 Feb 2026 00:16:23 +0000 (00:16 +0000)] 
Daily bump.

4 months agoa68: fix uninitialized memory in get_hole_symbol [PR algol68/124115]
Jose E. Marchesi [Mon, 16 Feb 2026 20:32:59 +0000 (21:32 +0100)] 
a68: fix uninitialized memory in get_hole_symbol [PR algol68/124115]

The function get_hole_symbol is supposed to set *addrp to either true
or false.  However it was only setting it to false, causing
uninitialized memory.

This patch also removes a gcc_asser tfrom a68_make_formal_hole_decl.
If the formal hole results in an empty symbol then it may result into
invalid assembly being generated, but that is akin to use an invalid
asm template.

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

PR algol68/124115
* a68-low-holes.cc (get_hole_symbol): Always set *addrp to avoid
uninitialized memory.
* a68-low.cc (a68_make_formal_hole_decl): Remove assert.

gcc/testsuite/ChangeLog

PR algol68/124115
* algol68/compile/formal-hole-2.a68: New test.

4 months agolibstdc++: Implement rvalue overload for basic_string::substr() [PR119745]
Tomasz Kamiński [Mon, 16 Feb 2026 09:18:34 +0000 (10:18 +0100)] 
libstdc++: Implement rvalue overload for basic_string::substr() [PR119745]

This paper implement the changes from P2438R2 basic_string::substr() &&
paper into C++26. The additional substr and constructor overload are
implemented only for SSO string, as they require mutating the content
(if reused), and thus would require copy of the string anyway for COW
strings. (In consequence allocators implicitly constructible from int
remain ambiguous for C++11 ABI strings, see r16-7497-gfa1149534d8580).

In addition to cases when the allocators are not compatible (equal),
this patch does not reuse (transfer) allocator storage, if the selected
substring fits inside the SSO buffer, so we do not risk keeping large
chunk of memory for few characters. (This also covers cases when the
source stored the content in the local buffer).

As this additional overloads are meant to be optimization, in contrast
to move constructor, the source is left unmodified if the allocation
is not transferred. This avoid introducing a write (of null terminator)
to previously untouched, heap allocated, memory.

Separate overloads for substr(size_type __pos, size_type __n) and
substr(size_type __pos == 0), that delegate to corresponding constructor,
are provided to avoid the check of __n against the length() in the later
case.

Finally, the signatures of existing substr() overload are not modified
(no longer required since C++20), which avoid any impact on the ABI.

PR libstdc++/119745

libstdc++-v3/ChangeLog:

* include/bits/basic_string.h (basic_string::_M_construct)
[__cplusplus >= 202302L]: Declare.
(basic_string::basic_string(basic_string&&, size_type, const _Alloc&))
(basic_string(basic_string&&, size_type, size_type, const _Alloc&))
(basic_string::substr(size_type, size_type) &&)
(basic_string::substr(size_type) &&) [__cplusplus >= 202302L]: Define.
* include/bits/basic_string.tcc (basic_string::_M_construct)
[__cplusplus >= 202302L]: Define.
* testsuite/21_strings/basic_string/operations/substr/rvalue.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>