]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
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>
4 months agolibstdc++: Rename std::submdspan_extents and std::submdspan_canonicalize_slices
Tomasz Kamiński [Mon, 16 Feb 2026 12:12:05 +0000 (13:12 +0100)] 
libstdc++: Rename std::submdspan_extents and std::submdspan_canonicalize_slices

This patch implements LWG 4491, addressing C++26 NB comments.

libstdc++-v3/ChangeLog:

* include/std/mdspan (std::submdspan_extents): Rename to...
(std::subextents): Renamed from submdspan_extents.
(std::submdspan_canonicalize_slices): Rename to...
(std::canonical_slices): Renamed from submdspan_canonicalize_slices.
* testsuite/23_containers/mdspan/submdspan/submdspan_canonicalize_slices.cc:
Move to...
* testsuite/23_containers/mdspan/submdspan/canonical_slices.cc: ...here.
Updated calls to submdspan_canonicalize_slices.
* testsuite/23_containers/mdspan/submdspan/submdspan_canonicalize_slices_neg.cc:
Move to...
* testsuite/23_containers/mdspan/submdspan/canonical_slices_neg.cc: ...here.
Updated calls to submdspan_canonicalize_slices.
* testsuite/23_containers/mdspan/submdspan/submdspan_extents.cc: Move to...
* testsuite/23_containers/mdspan/submdspan/subextents.cc: ...here.
Qualified and renamed calls to submdspan_extents.
* testsuite/23_containers/mdspan/submdspan/submdspan_extents_neg.cc: Move to...
* testsuite/23_containers/mdspan/submdspan/subextents_neg.cc: ...here.
Qualified and renamed calls to submdspan_extents.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agolibstdc++: implement formatter for std::filesystem::path
Ivan Lazaric [Mon, 9 Feb 2026 12:26:36 +0000 (13:26 +0100)] 
libstdc++: implement formatter for std::filesystem::path

This patch implements formatting for std::filesystem::path from P2845R8,
and defines the feature test macro __cpp_lib_format_path to 202403L,
provided only in <filesystem>.

Formatting options are performed (if applicable) in order:
'g', '?', transcoding, fill-and-align & width

The standard specifies transcoding behaviour only when literal encoding
is UTF-8, leaving all other cases implementation defined.
Current implementation of filesystem::path assumes:
* char encoding is UTF-8
* wchar_t encoding is either UTF-32 or UTF-16

libstdc++-v3/ChangeLog:

* include/bits/fs_path.h: Include bits/formatfwd.h.
(std::formatter<filesystem::path, _CharT>): Define.
* include/bits/version.def (format_path): Define.
* include/bits/version.h: Regenerate.
* include/std/filesystem: Expose __cpp_lib_format_path.
* testsuite/std/format/fs_path.cc: New test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Ivan Lazaric <ivan.lazaric1@gmail.com>
Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
4 months agotestsuite/103515 - adjust gcc.target/powerpc/pr103515.c
Richard Biener [Mon, 16 Feb 2026 09:20:52 +0000 (10:20 +0100)] 
testsuite/103515 - adjust gcc.target/powerpc/pr103515.c

The following marks the loop in foo1 as to not be vectorized to
restore old -O2 behavior and restore what the testcase was supposed
to verify.

PR testsuite/103515
* gcc.target/powerpc/pr103515.c: Mark the loop in foo1
with #pramga GCC novector.

4 months agoAda: Fix subpool dropped from allocator initialized by aggregate
Eric Botcazou [Mon, 16 Feb 2026 09:17:30 +0000 (10:17 +0100)] 
Ada: Fix subpool dropped from allocator initialized by aggregate

This plugs an annoying loophole, whereby the subpool indication present
in an allocator is dropped in some circumstances, most notably when the
allocator is initialized by an aggregate with defaulted components.

gcc/ada/
PR ada/124106
* exp_ch4.adb (Expand_N_Allocator): Minor fix in commentary.
(Expand_Allocator_Expression): Propagate the Subpool_Handle_Name
of the original allocator onto the newly built allocators.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
Use Preserve_Comes_From_Source to propagate Comes_From_Source.
(Make_CPP_Constructor_Call_In_Allocator): Likewise.

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

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

4 months agoChange int8_t to signed char on Solaris [PR113450,PR123176]
Rainer Orth [Sun, 15 Feb 2026 22:11:44 +0000 (23:11 +0100)] 
Change int8_t to signed char on Solaris [PR113450,PR123176]

int8_t is currently defined as char in Solaris <sys/int_types.h>

/*
 * Basic / Extended integer types
 *
 * The following defines the basic fixed-size integer types.
 *
 * Implementations are free to typedef them to Standard C integer types or
 * extensions that they support. If an implementation does not support one
 * of the particular integer data types below, then it should not define the
 * typedefs and macros corresponding to that data type.  Note that int8_t
 * is not defined in -Xs mode on ISAs for which the ABI specifies "char"
 * as an unsigned entity because there is no way to define an eight bit
 * signed integral.
 */
typedef char int8_t;
typedef signed char int8_t;

and _CHAR_IS_SIGNED defined as 1 in <sys/isa_defs.h>.  As has long been
known, this violates C99, 7.18.1.1, Exact-width integer types.

While this works in general nonetheless, it creates constant trouble for
C++ code as can be seen in PRs libstdc++/113450 and recently
libstdc++/123176, but also in LLVM.

While Oracle Solaris engineering is amenable to changing int8_t to
signed char, this will take time.  However, it proved easy to do so now
using fixincludes.

This works for a GCC bootstrap just fine with one exception: as
documented in PR d/123509, libdruntime has its own definition of int8_t
which is now inconsistent with GCC's.  This leads to some gdc.test and
libphobos testsuite failures, which can easily be fixed with the patch
attached to that PR.  I wouldn't consider this a showstopper for GCC 16
if that patch wouldn't make it to the release.

However, the failures point to another problem: with this change, the
mangling of

void func(int8_t);

changes in C++, creating an ABI break.  Fortunately, this isn't seen in
libstdc++, so the impact should be reasonable compared to the constant
trouble the current definition causes for C++.

Besides, clang already uses

#define __INT8_TYPE__ signed char

apparently without problems.

In case users do run into the incompatiblity, the fixed definitions are
wrapped in #if !defined(_LEGACY_INT8_T)/#endif so there's an easy way back
to the original definition.

Bootstrapped on i386-pc-solaris2.11, amd64-pc-solaris2.11,
sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11 with only the D
failure described above.

I've also run 1-stage and bootstrap builds of LLVM main using a patched
GCC 16 as bootstrap compiler on amd64-pc-solaris2.11 and
sparcv9-sun-solaris2.11 without regressions.

2026-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

fixincludes:
PR libstdc++/113450
PR libstdc++/123176
* inclhack.def (solaris_int8_t): New fix.
* fixincl.x: Regenerate.

gcc:
PR libstdc++/113450
PR libstdc++/123176
* config/sol2.h (INT8_TYPE): Change to signed char.
(INT_LEAST8_TYPE): Likewise.
(INT_FAST8_TYPE): Likewise.

4 months agodiagnostics: Fix bootstrap on 32b Darwin hosts.
Iain Sandoe [Sun, 15 Feb 2026 08:59:33 +0000 (08:59 +0000)] 
diagnostics: Fix bootstrap on 32b Darwin hosts.

The change in r16-7507 misses a cast on the value to pp_scalar which
leads to a bootstrap fail on 32b hosts where size_t has a different
declaration from the value.  Fixed by applying the fmt_size_t cast.

gcc/ChangeLog:

* json.cc (pointer::token::print): Cast the value to pp_scalar
with (fmt_size_t).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
4 months agoDisable simpe-call devirtualization of already devirtualized calls
Jan Hubicka [Sun, 15 Feb 2026 19:19:57 +0000 (20:19 +0100)] 
Disable simpe-call devirtualization of already devirtualized calls

Fix ICE caused by speculating already speculated target with auto-fdo.
ipa_devirt is supposed to consistently skip devirtualized edges (or just check
if devirtualization agrees with the static prediction when dumping).  This was
not hecked correctly in the simpe call path.

gcc/ChangeLog:

* ipa-devirt.cc (ipa_devirt): Improve statistics for multi-target
devirtualization; do not simple-call devirtualize already devirtualized calls.

4 months agoc++: non-trivial by-value deducing this lambda [PR121500]
Patrick Palka [Sun, 15 Feb 2026 17:36:38 +0000 (12:36 -0500)] 
c++: non-trivial by-value deducing this lambda [PR121500]

Here the lambda has a by-value capture of non-trivial type, which
in turn makes the closure type non-trivial.  This means its by-value
'this' parameter, which gets deduced to the closure type, becomes an
invisiref parameter, and so when lowering the operator() body we need to
adjust uses of 'this' by adding implicit dereferences.

But the GIMPLE dump for operator() shows that we miss some adjustments:

  bool main()::<lambda(this auto:1)>::operator()<main()::<lambda(this auto:1)> > (struct ._anon_0 & self)
  {
    bool D.3091;
    struct ._anon_0 & self.1;
    struct A a [value-expr: self.__a]; // should be self->__a

    self.1 = self;
    _1 = self.1.__a.n; // should be self.1->__a
    D.3091 = _1 == 42;
    return D.3091;
  }

Apparently this is because cp_genericize_r, which is responsible for the
invisiref use adjustments, never walks DECL_VALUE_EXPR.  This patch makes
us walk it.  For GCC 16, restrict the walking to xobj lambdas.

PR c++/121500

gcc/cp/ChangeLog:

* cp-gimplify.cc (cp_genericize_r): Walk DECL_VALUE_EXPR within
an xobj lambda.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoRemove HAVE_AS_FMAF_HPC_VIS3 etc. on SPARC
Rainer Orth [Sun, 15 Feb 2026 10:33:41 +0000 (11:33 +0100)] 
Remove HAVE_AS_FMAF_HPC_VIS3 etc. on SPARC

The SPARC ISA extensions guarded by HAVE_AS_FMAF_HPC_VIS3 etc. have been
supported both in the Solaris as and GNU as for a long time.  The
original Solaris 11.4 as supports all of them, and gas support has been
added over time:

  HAVE_AS_FMAF_HPC_VIS3 -xarch=v9d 2.22
  HAVE_AS_SPARC4                -xarch=sparc4 2.23.1
  HAVE_AS_SPARC5_VIS4           -xarch=sparc5           2.25
  HAVE_AS_SPARC6                -xarch=sparc6           2.29

Solaris requires binutils 2.30 already on trunk, and 2.29 can be
expected on other SPARC targets, too, so this patch removes all code
that checks for their presence.

Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas),
sparcv9-sun-solaris2.11 (as), and sparc64-unknown-linux-gnu.

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

gcc:
* configure.ac <sparc*-*-*> (gcc_cv_as_sparc_fmaf): Remove.
(gcc_cv_as_sparc_sparc4): Remove.
(gcc_cv_as_sparc_sparc): Remove.
(gcc_cv_as_sparc_sparc6): Remove.
* configure: Regenerate.
* config.in: Regenerate.

* config/sparc/sparc.h (AS_NIAGARA3_FLAG) Remove.  Replace uses by
definition.
(AS_NIAGARA4_FLAG): Likewise.
(AS_NIAGARA7_FLAG): Likewise.
(AS_M8_FLAG): Likewise.
* config/sparc/sol2.h [!HAVE_AS_SPARC4]: Remove.
(AS_SPARC32_FLAG): Remove.
(AS_SPARC64_FLAG): Remove.
(AS_NIAGARA3_FLAG) Replace uses by definition.
(AS_NIAGARA4_FLAG): Likewise.
(AS_NIAGARA7_FLAG): Likewise.
(AS_M8_FLAG): Likewise.
* config/sparc/sparc.cc (sparc_option_override):
[!HAVE_AS_FMAF_HPC_VIS3]: Remove.
[!HAVE_AS_SPARC4]: Likewise.
[!HAVE_AS_SPARC5_VIS4]: Likewise.
[!HAVE_AS_SPARC6]: Likewise.

4 months agoforwprop: Fix copy prop aggregates into return statements slightly [PR124099]
Andrew Pinski [Sat, 14 Feb 2026 19:33:01 +0000 (11:33 -0800)] 
forwprop: Fix copy prop aggregates into return statements slightly [PR124099]

So a few more restrictions are needed here.
First we don't need to change if the return statement is already
a RESULT_DECL nor deference of the RESULT_DECL.
Second proping a global variable into the return is ok for the most
part except enumtls does not know how to expand that correctly and things
go down hill. So restrict to non global vars now.

Bootstrapped and tested on x86_64-linux-gnu.
Also tested the testcase with TLS turned off so enumtls ran.

PR tree-optimization/124099

gcc/ChangeLog:

* tree-ssa-forwprop.cc (optimize_agr_copyprop_return): Don't do anything
if the return is already result decl or a deference of result decl.
Also reject non local var decls.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agoFortran: Prevent direct references to PDT instances [PR108663]
Paul Thomas [Sun, 15 Feb 2026 08:11:31 +0000 (08:11 +0000)] 
Fortran: Prevent direct references to PDT instances [PR108663]

2026-02-15  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/108663
* decl.cc (gfc_get_pdt_instance): Use PDT_PREFIX and
PDT_PREFIX_LEN.
* gfortran.h : Define PDT_PREFIX and PDT_PREFIX_LEN. Note that
PDT_PREFIX must have at least two upper case letters.
* module.cc (read_module): Use PDT_PREFIX and PDT_PREFIX_LEN.
* resolve.cc (resolve_typebound_procedure): Both pdt_template
and pdt_type resolve_bindings_derived dummies should be tested
for LEN type parameters being assumed.
* symbol.cc (gfc_pdt_is_instance_of): Update preceding comment
and use PDT_PREFIX_LEN.

gcc/testsuite
PR fortran/108663
* gfortran.dg/pdt_15.f03: Modify tree dump test for new prefix.
* gfortran.dg/pdt_71.f03: Ditto.
* gfortran.dg/pdt_79.f03: Ditto.
* gfortran.dg/pdt_84.f03: New test.

4 months agotestsuite: Fix pr124086-1.c for ia32 (and maybe others)
Andrew Pinski [Sun, 15 Feb 2026 06:29:18 +0000 (22:29 -0800)] 
testsuite: Fix pr124086-1.c for ia32 (and maybe others)

On some targets (ia32 for an example), sizeof long double
is not a power of 2, this means you can't create a vector
of it. So let's disable this testcase for non power of 2
sizeof long double. This needs to be done via a preprocessor
macro as vector_size would cause an error otherwise.

Committed as obvious after a test on x86_64 with -m32.

gcc/testsuite/ChangeLog:

* c-c++-common/torture/pr124086-1.c: Only enable
for power of 2 long double.

4 months agoDaily bump.
GCC Administrator [Sun, 15 Feb 2026 00:16:25 +0000 (00:16 +0000)] 
Daily bump.

4 months agolibgcobol: Add --with-target-libxml2{,-lib,-include}= configure options [PR122839]
Jakub Jelinek [Sat, 14 Feb 2026 17:05:38 +0000 (18:05 +0100)] 
libgcobol: Add --with-target-libxml2{,-lib,-include}= configure options [PR122839]

The following patch adds new configure options similar to ObjC/Algol68
--with-bdw-gc{,-lib,-include}= configure options where one can override
the default of -I /usr/include/libxml2 and -lxml2 for finding libxml2
headers and library.  Similarly to the bdw-gc options, the override can
be for all multilibs or just specific to each multilib.

Tested also with
../configure --enable-languages=c,c++,cobol --with-target-libxml2=/tmp/libxml2 \
--disable-bootstrap --disable-libsanitizer --disable-libgomp

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

PR cobol/122839
* configure.ac (--with-target-libxml2, --with-target-libxml2-include,
--with-target-libxml2-lib): New configure options, use those to find
libxml2.
(LIBXML2_CPPFLAGS, LIBXML2_LIBS): New AC_SUBSTs.
* Makefile.am (AM_CPPFLAGS): Add $(LIBXML2_CPPFLAGS) rather than
-I /usr/include/libxml2.
(libgcobol_la_LDFLAGS): Add $(LIBXML2_LIBS).
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.

* doc/install.texi (COBOL-Specific Options): New.

4 months agoRemove HAVE_AS_SPARC_GOTDATA_OP
Rainer Orth [Sat, 14 Feb 2026 15:21:23 +0000 (16:21 +0100)] 
Remove HAVE_AS_SPARC_GOTDATA_OP

Since the introduction of gcc_cv_as_flags on SPARC,
HAVE_AS_SPARC_GOTDATA_OP became undefined on sparcv9-sun-solaris2.11
with the native assembler.  This happens because /bin/as is now invoked
with -m64, but the test fails to assemble:

/bin/as: "gotdata_op.s", line 8: error: detect global register use not covered .register pseudo-op

While the test can be adjusted by the addition of

.register %g2, #scratch

which makes it work with both as -m32/-m64 and gas --32/--64, it
turns out the whole workaround has become unnecessary:

When trying all combinations of as/ld with -m32/-m64, with both the
original Solaris 11.4 as/ld and the current one, as well as gas/gld
2.20.1, 2.30, and 2.46, the only cases where the test fails are when
using gld 2.20.1.  Solaris/SPARC requires binutils 2.30 now, and 2.20.1
can be considered ancient history on Linux/sparc64, too.  Therefore the
test and the code guarded by it can just go.

Bootstrapped without regressions on sparc{,v9}-sun-solaris2.11 and
sparc64-unknown-linux-gnu.

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

gcc:
* configure.ac <sparc*-*-*> (gcc_cv_as_sparc_gotdata_op): Remove.
* configure: Regenerate.
* config.in: Regenerate.
* config/sparc/sparc.md [!HAVE_AS_SPARC_GOTDATA_OP]: Remove.

4 months agoVAX: Fix ICE in fixup_reorder_chain when building gimple_match.cc [PR112400]
Kalvis Duckmanton [Sat, 14 Feb 2026 15:10:15 +0000 (15:10 +0000)] 
VAX: Fix ICE in fixup_reorder_chain when building gimple_match.cc [PR112400]

When cross-compiling itself for VAX, GCC terminates abruptly with an ICE
when compiling gimple_match.cc; the root cause seems to be an
incompletely removed computed jump instruction, which causes the
assertion in cfgrtl.cc around line 4083, to no longer hold.

I have verified that the problem is present in GCC 15.2.0 and believe
that it's also present in trunk (based on the fact that the patterns for
the "casesi1" and "*casesi1" instructions in 15.2.0 and trunk are the
same).

To fix this issue wrap the limit operand in a USE, to allow `single_set'
to identify it as an RTL expression setting PC.  This allows the
optimizer to optimize away case statements branching only to a basic
block, removing the ICE.

Include a test case reduced from gimple_match.cc, which demonstrates the
problem in GCC 15.2.0 on NetBSD/amd64 cross-compiling for VAX.

gcc/
PR target/112400
* config/vax/vax.md (casesi1): Wrap naked operand 1 with a USE
where used with the insn split to.
(*casesi1): Likewise naked incoming operand 1.

gcc/testsuite/
PR target/112400
* g++.dg/torture/pr112400.C: New file.

4 months agoVAX: Fix invalid RTX operand access in `nonindexed_address_p'
Maciej W. Rozycki [Sat, 14 Feb 2026 14:24:46 +0000 (14:24 +0000)] 
VAX: Fix invalid RTX operand access in `nonindexed_address_p'

Replace an unguarded early access to the incoming RTX's operand 0 in
`nonindexed_address_p' with direct accesses at the actual use places,
fixing a libgcc build error:

during RTL pass: reload
.../libgcc/libgcc2.c: In function '__udiv_w_sdiv':
.../libgcc/libgcc2.c:649:1: internal compiler error: RTL check: expected elt 0 type 'e' or 'u', have 'r' (rtx reg) in nonindexed_address_p, at config/vax/vax.cc:1826

where `--enable-checking=rtl' has been specified so as to enable RTL
consistency checks.

gcc/
* config/vax/vax.cc (nonindexed_address_p): Move incoming RTX's
operand 0 access to the actual use places.

4 months agofortran: Fix DO CONCURRENT nested-in-block iterator counting [PR123943]
Christopher Albert [Wed, 11 Feb 2026 23:06:13 +0000 (00:06 +0100)] 
fortran: Fix DO CONCURRENT nested-in-block iterator counting [PR123943]

Fix iterator-depth pre-counting in gfc_resolve_forall for nested
DO CONCURRENT/FORALL constructs inside block arms (e.g. IF/ELSE,
SELECT CASE).  The previous logic only scanned a flat next-chain,
which could undercount and trigger an ICE assertion.

Add a regression test based on a reduced testcase from Harald Anlauf.
Adjust wording in one comment to avoid GNU-style checker complaints.

PR fortran/123943

gcc/fortran/ChangeLog:

* resolve.cc (gfc_max_forall_iterators_in_chain): New helper
function for factorization of iterator-depth counting.
(gfc_count_forall_iterators): Use it.

gcc/testsuite/ChangeLog:

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

Co-authored-by: Harald Anlauf <anlauf@gcc.gnu.org>
Signed-off-by: Christopher Albert <albert@tugraz.at>
4 months agoFortran: Implement the COSHAPE intrinsic [PR99250]
Paul Thomas [Sat, 14 Feb 2026 08:48:11 +0000 (08:48 +0000)] 
Fortran: Implement the COSHAPE intrinsic [PR99250]

2026-02-14  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/99250
* check.cc (gfc_check_coshape): New function.
* gfortran.h: Add GFC_ISYM_COSHAPE to gfc_isym_id.
* intrinsic.cc (add_functions): Add the coshape prototype and
its 'make_generic'.
* intrinsic.h: Add prototypes for gfc_check_coshape and
gfc_resolve_coshape.
* intrinsic.texi : Add entries for coshape.
* iresolve.cc (gfc_resolve_coshape): New function.
* trans-array.cc (gfc_conv_ss_startstride): Add 'case
GFC_ISYM_COSHAPE' in two places.
* trans-intrinsic.cc (conv_intrinsic_cobound): Modify assert in
scalarized section for lbound. Set bound to zero for scalar
case of coshape. Keep the lbound and use it together with the
scalarized ubound to obtain the coshape.
(gfc_conv_intrinsic_function, gfc_add_intrinsic_ss_code and
gfc_walk_intrinsic_function): Add 'case GFC_ISYM_COSHAPE' as
appropriate.

gcc/testsuite/
PR fortran/99250
* gfortran.dg/coshape_1.f90: New test.

4 months agocomplex-lowering: Fix up extraction with VCEs [PR124086]
Andrew Pinski [Fri, 13 Feb 2026 19:30:53 +0000 (11:30 -0800)] 
complex-lowering: Fix up extraction with VCEs [PR124086]

This was an oversight on my part when I converted extract_component
to use gimple_build_assign instead of force_gimple_operand_gsi.
I had provided a special case for VCE of a SSA_NAME but I missed
that the same issue would be caused with invariants too and invariants
would show up with VCE; I assumed they would be folded.
This changes the check to include invariants too.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/124086

gcc/ChangeLog:

* tree-complex.cc (extract_component): Extend the check
for ssa names for VCE to include invariants.

gcc/testsuite/ChangeLog:

* c-c++-common/torture/pr124086-1.c: New test.
* g++.dg/torture/pr124086-1.C: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agotestsuite: Limit dump check of copy-prop-aggregate-return-1.c to x86_64 and aarch64
Andrew Pinski [Sat, 14 Feb 2026 04:02:55 +0000 (20:02 -0800)] 
testsuite: Limit dump check of copy-prop-aggregate-return-1.c to x86_64 and aarch64

This testcase fails on some targets so just limit to x86_64 (non-ia32) and aarch64
which are known to work here.

Pushed as obvious after testing.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/copy-prop-aggregate-return-1.c: Limit check to x86_64
and aarch64.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agotestsuite: Disable uninit-pr95825-1.C if address sanitizer is not supported
Andrew Pinski [Sat, 14 Feb 2026 03:54:15 +0000 (19:54 -0800)] 
testsuite: Disable uninit-pr95825-1.C if address sanitizer is not supported

I had forgot to check to make sure address sanitizer is supported.
Disable this test case if there is no address sanitizer.

Pushed as obvious after testing it.

gcc/testsuite/ChangeLog:

* g++.dg/warn/uninit-pr95825-1.C: Skip if no address sanitizer.

4 months agoDaily bump.
GCC Administrator [Sat, 14 Feb 2026 00:16:28 +0000 (00:16 +0000)] 
Daily bump.

4 months agosarif-replay: fix escaping of JSON Pointer
David Malcolm [Fri, 13 Feb 2026 22:18:49 +0000 (17:18 -0500)] 
sarif-replay: fix escaping of JSON Pointer

gcc/ChangeLog:
* json-parsing.cc (selftest::assert_json_pointer_eq): New.
(ASSERT_JSON_POINTER_EQ): New.
(selftest::test_parse_object): Add tests of JSON pointer.
(selftest::test_pointer_escaping): New test.
(selftest::json_parser_cc_tests): Call it.
* json.cc (json::pointer::token::print): New.
(json::value::print_pointer): New.
* json.h (json::pointer::token::print): New decl.
(json::value::print_pointer): New decl.
* libsarifreplay.cc: Include pretty-print.h.
(make_logical_location_from_jv): Use
json::pointer::token::print for short_name.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months ago[PR124079, LRA]: Fix broken s390 SPEC2017 benchmarks
Vladimir N. Makarov [Fri, 13 Feb 2026 18:58:41 +0000 (13:58 -0500)] 
[PR124079, LRA]: Fix broken s390 SPEC2017 benchmarks

Recent patch for PR121191 broke compilation of s390 SPEC benchmarks.
This patch fixes it.  The patch uses existing lra_constraint_offset to
calculate offsets.  The same function is used to find invalid matching
reloads.

gcc/ChangeLog:

PR rtl-optimization/124079
* lra-constraints.cc (get_matching_reload_reg_subreg): Add new arg
rclass.  Use another condition to use lowpart_subreg.  Use lra_constraint_offset
to calculate the subreg offset.
(get_reload_reg, match_reload): Pass the new arg.

gcc/testsuite/ChangeLog:

PR rtl-optimization/124079
* gcc.target/s390/pr124079.c: New.

4 months agocobol: Optimized alpha-to-alpha moves. [PR119455]
Robert Dubner [Fri, 13 Feb 2026 18:26:47 +0000 (13:26 -0500)] 
cobol: Optimized alpha-to-alpha moves. [PR119455]

Code for implementing many common scenarios of "MOVE <literal> TO
<alphanumeric>" and " MOVE <alphanumeric> to <alphanumeric> " is created
directly through GENERIC rather than by calling the general-purpose
libgcobol __gg__move routine.

gcc/cobol/ChangeLog:

PR cobol/119455
* genapi.cc (mh_source_is_group): Formatting.
(mh_source_is_literalA): Implement accelerated move.
(mh_alpha_to_alpha): New function; implements accelerated move.
(move_helper): Calls new mh_alpha_to_alpha.

4 months agoforwprop: Add copy prop for aggregates into a return [PR95825]
Andrew Pinski [Fri, 13 Feb 2026 04:36:33 +0000 (20:36 -0800)] 
forwprop: Add copy prop for aggregates into a return [PR95825]

I didn't implement this before today as I had not see any code
where this would make a difference. I noticed while looking into
regressions an uninitialized warning that shows up only with
-fsanitize=address. This because SRA causes some extra total
scalaization when using -fsanitize=address. Which in turn exposes
an uninitialized warning. This fixes the uninitialized warning
by doing a simple copy prop into the return statement.

That is if we have:
```
  D.3407 = D.3418;
  return D.3407;
```

turn it into:
```
  D.3407 = D.3418;
  return D.3418;
```

This forces SRA not to do total scalarization on D.3418 and allows for better code
too.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/95825

gcc/ChangeLog:

* tree-ssa-forwprop.cc (optimize_agr_copyprop_return): New function.
(optimize_agr_copyprop): Call optimize_agr_copyprop_return
for return statements.

gcc/testsuite/ChangeLog:

* g++.dg/warn/uninit-pr95825-1.C: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-return-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agoc++/reflection: various diagnostic tweaks
Marek Polacek [Tue, 10 Feb 2026 18:24:44 +0000 (13:24 -0500)] 
c++/reflection: various diagnostic tweaks

This patch improves various reflection diagnostics as discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2025-December/704168.html>.

In particular:
- reword "not usable" diagnostics to say what kind of reflections we
  expected,
- use the new inform_tree_category to better describe what kind of reflection
  we actually got,
- when we see a missing 'template' keyword, emit a -Wmissing-template-keyword
  warning instead of giving a hard error (this should only happen when the
  code would be valid with the 'template' added.

gcc/cp/ChangeLog:

* cp-tree.h (inform_tree_category): Declare.
* error.cc (inform_tree_category): New.
* parser.cc (cp_parser_splice_specifier): Use OVL_FIRST when checking
for TEMPLATE_DECL.
(cp_parser_splice_type_specifier): Reword an error message.  Call
inform_tree_category.
(cp_parser_splice_expression): Check check_splice_expr earlier.  Reword
error messages.  Call inform_tree_category.  Turn an error into an
assert.  Use missing_template_diag instead of giving an error about
a missing 'template' keyword.
(cp_parser_splice_scope_specifier): Reword an error message.  Call
inform_tree_category.
(missing_template_diag): Forward declare.  Drop "enum" in a parameter.
* reflect.cc (check_splice_expr): Reword error messages.  Call
inform_tree_category.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/crash10.C: Adjust expected diagnostics.
* g++.dg/reflect/crash2.C: Likewise.
* g++.dg/reflect/crash3.C: Likewise.
* g++.dg/reflect/crash7.C: Likewise.
* g++.dg/reflect/crash9.C: Likewise.
* g++.dg/reflect/dep5.C: Likewise.
* g++.dg/reflect/diag1.C: Likewise.
* g++.dg/reflect/error10.C: Likewise.
* g++.dg/reflect/error12.C: Likewise.
* g++.dg/reflect/error5.C: Likewise.
* g++.dg/reflect/expr3.C: Likewise.
* g++.dg/reflect/member1.C: Likewise.
* g++.dg/reflect/ns2.C: Likewise.  Test more cases.
* g++.dg/reflect/p2996-12.C: Likewise.
* g++.dg/reflect/splice5.C: Likewise.
* g++.dg/reflect/diag1a.C: New test.
* g++.dg/reflect/diag1b.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoc++: Fix up consteval-only diagnostics with structured bindings [PR124012]
Jakub Jelinek [Fri, 13 Feb 2026 15:11:07 +0000 (16:11 +0100)] 
c++: Fix up consteval-only diagnostics with structured bindings [PR124012]

We ICE on the following testcase, because a constexpr structured binding
with consteval-only initializer of the whole struct but not for this exact
structured binding is used in a context where it is not constant evaluated
and folded into a constant.

The problem is that check_out_of_consteval_use during walking didn't walk
DECL_VALUE_EXPR of vars it sees being used.  So we haven't noticed invalid
consteval-only use, the consteval-only base of the structured binding isn't
gimplified but the structured binding referencing that in its
DECL_VALUE_EXPR is and so we ICE during gimplification.
In order to fix that, I had to move the lambda into a separate function
(similarly to why consteval_only_type_r is not a lambda) so that it can
recurse with that.

That isn't the only problem though.  DECL_VALUE_EXPR in this case is just
COMPONENT_REF with the underlying VAR_DECL (which is consteval-only).
But walker had:
      if (VAR_P (t)
          && (DECL_DECLARED_CONSTEXPR_P (t) || DECL_DECLARED_CONSTINIT_P (t)))
        /* This is fine, don't bother checking the type.  */
        return NULL_TREE;
and so wouldn't report anything even after the fix.
The reason why it works correctly in the
  constexpr auto a = A {};
  foo (a.a);                   // { dg-error "consteval-only expressions are only allowed in a constant-evaluated context" }
case is that in that case (no DECL_VALUE_EXPR) there is COMPONENT_REF
of VIEW_CONVERT_EXPR of the VAR_DECL (i.e. location wrapper) and so we
diagnose it on the location wrapper.  That is just weird, we really
shouldn't depend on location wrappers being there for correct behavior
(rather than just for better locations).  That if is there because
cp_finish_decl calls check_out_of_consteval_use on the whole VAR_DECL
and in that case we want to avoid diagnosing anything if it is
constexpr/constinit var.  Maybe we just shouldn't call
check_out_of_consteval_use at all, though this patch moves that check to
an early out in that function rather than during the walk (similarly
to early out for expr == NULL_TREE which also happens occassionally).
If we see a constexpr/constinit VAR_DECL which is consteval-only
nested somewhere deep inside of other expressions, we should diagnose
that.

On Wed, Feb 11, 2026 at 08:58:26PM +0900, Jason Merrill wrote:
> I'd drop constinit, that doesn't seem to qualify under
> [basic.types.general]/12.1.

You're right.  Seems constinit was still in P2996R9 but P2996R10
has removed it except for one occurrence in the revision history (that
is ok, but surprisingly the P2996R10 change that removed it is not
mentioned).  So, this patch additionally stops special casing constinit
for consteval-only checks anywhere, only constexpr is significant.

There is an unresolved part of the PR, if there is
  constexpr auto a = A {};
  int b = a.a;
then we don't reject that (similarly after the patch with constexpr
structured binding).  The problem in that case is that we try to
constant evaluate initializers of vars (and a few other spots) and
if they fold to constants (like in this case to 0) even when it is
not manifestly constant-evaluated, we just replace it with the constant
and so don't see there was a consteval-only use that should have
been reported.  Of course, if it is something manifestly constant-evaluated
and folds into constant, it shouldn't be rejected.
So I wonder if we don't need to call check_out_of_consteval_use in
further spots...

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

PR c++/124012
* reflect.cc (check_out_of_consteval_use_r): New function.
(check_out_of_consteval_use): Use it instead of lambda.  Don't ignore
constexpr/constinit vars in the walker and walk DECL_VALUE_EXPR of
vars which have it.  Ignore expr equal to constexpr VAR_DECL.  In
diagnostics only complain about missing constexpr on VAR_DECLs without
that flag and never suggest constinit.  Remove constinit traces from
function comment.

* g++.dg/reflect/pr124012.C: New test.
* g++.dg/reflect/init1.C (r): Change constinit to constexpr.
(p): Change constinit to constexpr const.
* g++.dg/reflect/init6.C: Expect diagnostics for constinit
consteval-only vars.
* g++.dg/reflect/init7.C: Likewise.
* g++.dg/reflect/init10.C: Likewise.
* g++.dg/reflect/diag3.C: Likewise.  Don't expect suggestion to
add constinit.

4 months agotestsuite/115827 - avoid false negative because of CCP
Richard Biener [Fri, 13 Feb 2026 14:16:28 +0000 (15:16 +0100)] 
testsuite/115827 - avoid false negative because of CCP

The following adjusts two uninit testcases to avoid a false negative
that appears when using -msoft-float on arm because the testcase
then mutates into a classical case of CCP eliding

  # _11 = PHI <1.0e+0(2), f$real_9(D)(3)>

Avoid this by using a non-constant.  And avoid flipping locations
for the diagnostic by not duplicating the return statement.

PR testsuite/115827
* gcc.dg/auto-init-uninit-17.c: Avoid CCP.
* gcc.dg/uninit-17.c: Likewise.

4 months agodiagnostics: don't cache logical_loc_mgr in html_sink [PR124014]
David Malcolm [Fri, 13 Feb 2026 13:26:50 +0000 (08:26 -0500)] 
diagnostics: don't cache logical_loc_mgr in html_sink [PR124014]

r16-7422-g13c2da6cdbd1a3 fixed an ICE that was due to caching of the
logical_locations::manager * in sarif_sink.

Do the same for html_sink.

gcc/ChangeLog:
PR diagnostics/124014
* diagnostics/html-sink.cc (html_builder::get_logical_loc_mgr):
New.
(html_builder::m_logical_loc_mgr): Drop field.
(html_builder::html_builder): Drop initialization of
m_logical_loc_mgr.
(html_builder::maybe_make_state_diagram): Use get_logical_loc_mgr
rather than m_logical_loc_mgr.
(html_builder::make_element_for_diagnostic): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agotree-optimization/99959 - fixup DECL_NONLOCAL_FRAME use
Richard Biener [Fri, 13 Feb 2026 11:39:44 +0000 (12:39 +0100)] 
tree-optimization/99959 - fixup DECL_NONLOCAL_FRAME use

DECL_NONLOCAL_FRAME is only valid on VAR_DECL.

PR tree-optimization/99959
* tree-sra.cc (create_access_replacement): Guard DECL_NONLOCAL_FRAME
access.

4 months agoFix gcc/testsuite/*/gomp/pr113436* [PR113436]
Tobias Burnus [Fri, 13 Feb 2026 11:29:03 +0000 (12:29 +0100)] 
Fix gcc/testsuite/*/gomp/pr113436* [PR113436]

Testcases in gcc/testsuite/ may not '#include <omp.h>' or 'use omp_lib';
instead, now a local declaration of the enum/Fortran-parameter values is
used.

gcc/testsuite/ChangeLog:

PR middle-end/113436
* c-c++-common/gomp/pr113436-1.c: Replace '#include <omp.h>' by
local declaration for omp_allocator_handle_t.
* c-c++-common/gomp/pr113436-2.c: Likewise.
* g++.dg/gomp/pr113436.C: Likewise.
* gfortran.dg/gomp/pr113436-1.f90: Replace 'use omp_lib' by local
omp_*_mem_alloc parameter declarations.
* gfortran.dg/gomp/pr113436-2.f90: Likewise.
* gfortran.dg/gomp/pr113436-3.f90: Likewise.
* gfortran.dg/gomp/pr113436-4.f90: Likewise.

4 months agolibstdc++: Make __gnu_test:uneq_allocator(int) constructor explicit.
Tomasz Kamiński [Thu, 12 Feb 2026 21:50:16 +0000 (22:50 +0100)] 
libstdc++: Make __gnu_test:uneq_allocator(int) constructor explicit.

Presence implicit conversion from int to it's allocator, makes constructing
string from rvalue of same string type and int ambiguous, as none of following
candidates is better:
  basic_string(basic_string&&, allocator_type)
  // conversion from int to allocator for second argument
  basic_string(const basic_string&, int, allocator_type)
  // reference adjustment for first argument

This makes __gnu_test:uneq_allocator(int) constructor explicit, to avoid
above issues.

libstdc++-v3/ChangeLog:

* testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc
(__gnu_test::uneq_allocator(int)): Declare as explicit.
* testsuite/std/memory/indirect/ctor.cc: Construct uneq_allocator
from int explicitly.
* testsuite/std/memory/polymorphic/ctor.cc: Likewise.
* testsuite/std/memory/polymorphic/ctor_poly.cc: Likewise.
* testsuite/util/testsuite_allocator.h: Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agotree-optimization/99959 - handle FRAME in SRA for diagnostics
Richard Biener [Fri, 13 Feb 2026 08:42:01 +0000 (09:42 +0100)] 
tree-optimization/99959 - handle FRAME in SRA for diagnostics

The following includes DECL_NONLOCAL_FRAME in the processing for
setting debug expressions on access replacements, avoiding disabling
diagnostics.

PR tree-optimization/99959
* tree-sra.cc (create_access_replacement): Always create
debug expressions for DECL_NONLOCAL_FRAME bases.

* gcc.dg/uninit-pr99959.c: New testcase.

4 months agolibstdc++: Make CTAD ignore tuple(const Types&...) constructor [PR121771]
Jonathan Wakely [Wed, 11 Feb 2026 22:39:52 +0000 (22:39 +0000)] 
libstdc++: Make CTAD ignore tuple(const Types&...) constructor [PR121771]

This is similar to the r16-3536-g0bb0d1d2880d56 change for std::pair, so
that CTAD ignores the tuple(const Types&...) constructor and only uses
the tuple(Types...) -> tuple<Types...> deduction guide. This ensures
that the deduced type comes from the decayed argument types.

libstdc++-v3/ChangeLog:

PR libstdc++/121771
* include/std/tuple (tuple::tuple(const Elements&...)): Use
type_identity_t to prevent constructor being used for CTAD.
(tuple::tuple(allocator_arg_t, const A&, const Elements&...)):
Likewise.
* testsuite/20_util/tuple/cons/121771.cc: New test.

Reviewed-by: Ville Voutilainen <ville.voutilainen@gmail.com>
4 months agoAutoFDO: Update profile_merger gcov_version to 3
Dhruv Chawla [Thu, 12 Feb 2026 08:54:50 +0000 (08:54 +0000)] 
AutoFDO: Update profile_merger gcov_version to 3

This patch should have been a part of r16-6348-g4dfa48077e3892 but
unfortunately I forgot to bump these versions with it.

Bootstrapped and regtested on aarch64-linux-gnu.

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* Makefile.in (all.fda): Bump profile_merger gcov_version to 3.

gcc/c/ChangeLog:

* Make-lang.in (cc1.fda): Likewise.

gcc/cp/ChangeLog:

* Make-lang.in (cc1plus.fda): Likewise.

gcc/lto/ChangeLog:

* Make-lang.in (lto1.fda): Likewise.

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

4 months agoc: Handle REALPART_EXPR and IMAGPART_EXPR in fold_offsetof [PR105555]
Andrew Pinski [Thu, 12 Feb 2026 17:07:10 +0000 (09:07 -0800)] 
c: Handle REALPART_EXPR and IMAGPART_EXPR in fold_offsetof [PR105555]

In some cases the C front-end calls into fold_offsetof to fold
an address but that does not handle REALPART_EXPR nor IMAGPART_EXPR so
gcc produces an internal compiler error. For offsetof, REALPART_EXPR/IMAGPART_EXPR
won't show up which is why they were not there before.

Bootstrapped and tested on x86_64-linux-gnu.

PR c/105555

gcc/c-family/ChangeLog:

* c-common.cc (fold_offsetof): Handle REALPART_EXPR
and IMAGPART_EXPR.

gcc/testsuite/ChangeLog:

* gcc.dg/complex-10.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agoc++: constrained auto NTTP vs associated constraints
Patrick Palka [Thu, 12 Feb 2026 23:20:36 +0000 (18:20 -0500)] 
c++: constrained auto NTTP vs associated constraints

According to [temp.param], the constraint on an auto NTTP is an
associated constraint and so should be checked as part of satisfaction
of the overall associated constraints, but we currently don't include
them in the template's associated constraints and instead check them
separately during template argument coercion/deduction.

Fixing this is mostly a matter of storing the NTTP's constraint inside
TEMPLATE_PARM_CONSTRAINTS instead of PLACEHOLDER_TYPE_CONSTRAINTS and
generalizing the relevant template parameter processing subroutines to
also handle such NTTPs.

While this is straightfoward for "simple" constrained autos, it was
later noticed that for e.g. 'C auto* P' or 'D auto& Q' it's not clear
how to express their constraint as an associated constraint.  For P an
option would be C<decltype(*P)>, but for Q it's not clear how to pass
the referenced type to C.  C<decltype(auto(Q))> would be wrong because
we don't want to decay function/array types.

So this patch sidesteps this question by preserving the existing
behavior for such "non-simple" constrained auto (i.e. don't add them
to the associated constraints, and continue ad-hoc checking them during
do_auto_deduction).  The simple case is by far the most common anyway.

The main observeable difference with this change is that such
constrained auto NTTPs are now involved in the "more constrained"
determination during partial ordering.

gcc/cp/ChangeLog:

* constraint.cc (finish_shorthand_constraint): Add is_non_type
parameter.  Handle constrained auto NTTPs.
* cp-tree.h (copy_template_args): Declare.
(expand_template_argument_pack): Declare.
(finish_shorthand_constraint): Adjust declaration.
* mangle.cc (write_template_param_decl): Obtain constraints of
an auto NTTP through TEMPLATE_PARM_CONSTRAINTS instead of
PLACEHOLDER_TYPE_CONSTRAINTS.
* parser.cc (cp_parser_constrained_type_template_parm): Inline
into its only caller and remove.
(cp_parser_constrained_non_type_template_parm): Likewise.
(finish_constrained_parameter): Simplify after the above.  Replace
the type of an ordinary constrained auto NTTP with a
non-constrained one and set TEMPLATE_PARM_CONSTRAINTS for it.
(cp_parser_template_parameter): Dispatch to
finish_constrained_parameter for a constrained auto NTTP.
* pt.cc (process_template_parm): Pass is_non_type to
finish_shorthand_constraint.  Use TEMPLATE_PARM_CONSTRAINTS
instead of TREE_TYPE for clarity.
(expand_template_argument_pack): Remove forward declaration.
(copy_template_args): Likewise.
(make_constrained_placeholder_type): Return the type not the
TYPE_NAME for consistency with make_auto_1 etc.
(do_auto_deduction): Assert we no longer see simple constrained
autos during coercion/deduction.

gcc/testsuite/ChangeLog:

* g++.dg/cpp26/pack-indexing15.C: Adjust expected error upon
constrained auto NTTP satisfaction failure.
* g++.dg/cpp2a/concepts-placeholder12.C: Likewise.
* g++.dg/cpp2a/concepts-pr97093.C: Likewise.
* g++.dg/cpp2a/concepts-template-parm2.C: Likewise.
* g++.dg/cpp2a/concepts-template-parm6.C: Likewise.
* g++.dg/cpp2a/concepts-template-parm12.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agocobol: Eliminate strict-aliasing violations. [PR121499]
Robert Dubner [Thu, 12 Feb 2026 20:18:23 +0000 (15:18 -0500)] 
cobol: Eliminate strict-aliasing violations.  [PR121499]

Code violating strict aliasing has been refactored.

libgcobol is now being built with
-fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3

Copyright boilerplate has been updated to the year 2026 throughout gcc/cobol
and libgcobol.

gcc/cobol/ChangeLog:

* cbldiag.h: Copyright updated to 2026.
* cdf-copy.cc: Likewise.
* cdf.y: Likewise.
* cdfval.h: Likewise.
* cobol-system.h: Likewise.
* convert.cc: Likewise.
* copybook.h: Likewise.
* except.cc: Likewise.
* exceptg.h: Likewise.
* genapi.cc: Likewise.
* genapi.h: Likewise.
* gengen.cc: Likewise.
* gengen.h: Likewise.
* genmath.cc: Likewise.
* genmath.h: Likewise.
* genutil.cc: Likewise.
* genutil.h: Likewise.
* inspect.h: Likewise.
* lang-specs.h: Likewise.
* lexio.cc: Likewise.
* lexio.h: Likewise.
* messages.cc: Likewise.
* parse.y: Likewise.
* parse_ante.h: Likewise.
* parse_util.h: Likewise.
* scan.l: Likewise.
* scan_ante.h: Likewise.
* scan_post.h: Likewise.
* show_parse.h: Likewise.
* structs.cc: Likewise.
* structs.h: Likewise.
* symbols.cc: Likewise.
* symbols.h: Likewise.
* symfind.cc: Likewise.
* util.cc: Likewise.
* util.h: Likewise.

libgcobol/ChangeLog:

PR cobol/121499
* LICENSE: Copyright updated to 2026.
* Makefile.am: Compile with -fstrict-aliasing.
* Makefile.in: Autoreconf.
* acinclude.m4: Copyright updated to 2026.
* charmaps.cc: Likewise.
* charmaps.h: Likewise.
* common-defs.h: Likewise.
* configure.tgt: Likewise.
* constants.cc: Likewise.
* ec.h: Likewise.
* encodings.h: Likewise.
* exceptl.h: Likewise.
* gcobolio.h: Likewise.
* gfileio.cc: Likewise.
* gfileio.h: Likewise.
* gmath.cc (multiply_int256_by_int64): Eliminate aliasing.
(divide_int256_by_int64): Likewise.
(multiply_int128_by_int128): Likewise.
(divide_int128_by_int128): Likewise.
* gmath.h: Copyright updated to 2026.
* intrinsic.cc: Likewise.
* io.cc: Likewise.
* io.h: Likewise.
* libgcobol.cc: Likewise.
* libgcobol.h: Likewise.
* stringbin.cc: Likewise.
* stringbin.h: Likewise.
* valconv.cc: Likewise.
* valconv.h: Likewise.
* xmlparse.cc: Likewise.

4 months agolibstdc++/regex: Avoid -Wunused-parameter warnings in _Executor
Patrick Palka [Thu, 12 Feb 2026 20:17:57 +0000 (15:17 -0500)] 
libstdc++/regex: Avoid -Wunused-parameter warnings in _Executor

Now that _Executor is non-recursive most subroutines no longer use their
_Match_mode parameter (previously it was just passed to recursive _M_dfs
calls).  For now, just make them unnamed to avoid warnings.

libstdc++-v3/ChangeLog:

* include/bits/regex_executor.tcc (_Executor::_M_rep_once_more):
Make unnused _Match_mode parameter unnamed.
(_Executor::_M_handle_repeat): Likewise.
(_Executor::_M_handle_subexpr_begin): Likewise.
(_Executor::_M_handle_subexpr_end): Likewise.
(_Executor::_M_handle_line_begin_assertion): Likewise.
(_Executor::_M_handle_line_end_assertion): Likewise.
(_Executor::_M_handle_match): Likewise.
(_Executor::_M_handle_backref): Likewise.
(_Executor::_M_handle_alternative): Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
4 months agoc++: adjust comment from previous commit r16-7487
Patrick Palka [Thu, 12 Feb 2026 20:14:11 +0000 (15:14 -0500)] 
c++: adjust comment from previous commit r16-7487

The comment from r16-7487 is confused, the object argument of PMF
calls _must_ be sequenced first by [expr.call]/7 since syntactically
it appears in the postfix-expression: (a.*pmf)(...).

It's indirect calls to a (known) xobj memfn that don't need such
sequencing, since syntactically the object argument isn't in the
postfix-expression: (&A::f)(a, ...).

gcc/cp/ChangeLog:

* cp-gimplify.cc (cp_gimplify_expr) <case CALL_EXPR>: Adjust
r16-7487 comment.

4 months agoc++: evaluation order of xobj memfn call [PR123989]
Patrick Palka [Thu, 12 Feb 2026 19:44:56 +0000 (14:44 -0500)] 
c++: evaluation order of xobj memfn call [PR123989]

The object argument of an xobj memfn call needs to be evaluated before its
formal arguments, like with an iobj memfn call.  This patch generalizes the
existing such handling in cp_gimplify_expr for METHOD_TYPE callees to also
accept xobj memfn callees.

PR c++/123989

gcc/cp/ChangeLog:

* cp-gimplify.cc (cp_gimplify_expr) <case CALL_EXPR>: Evaluate
the object argument of an xobj memfn call first too.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Marek Polacek <polacek@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agolibstdc++: Don't test for __unused on Glibc targets
Xi Ruoyao [Thu, 12 Feb 2026 18:46:05 +0000 (18:46 +0000)] 
libstdc++: Don't test for __unused on Glibc targets

x86_64 glibc has started to use it since the 2.43 release, but is
expected to fix it before the 2.44 release.

Link: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b9579342c68b#patch67
libstdc++-v3/ChangeLog:

* testsuite/17_intro/badnames.cc (__unused): Do not define.
* testsuite/17_intro/names.cc [glibc == 2.43] (__unused): Undef.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
4 months agolibstdc++: Fix fallback definitions of std::is_member_*_pointer
Jonathan Wakely [Thu, 12 Feb 2026 18:52:12 +0000 (18:52 +0000)] 
libstdc++: Fix fallback definitions of std::is_member_*_pointer

When the builtins aren't used we need a declaration of std::is_function
for the fallback definitions of std::is_member_function_pointer and
std::is_member_object_pointer.

libstdc++-v3/ChangeLog:

* include/std/type_traits (is_function): Declare before first
use.

4 months agoCRIS: Make sure cstore<mode>4, cbranch<mode>4 don't have two memory operands
Hans-Peter Nilsson [Mon, 9 Feb 2026 20:34:10 +0000 (21:34 +0100)] 
CRIS: Make sure cstore<mode>4, cbranch<mode>4 don't have two memory operands

Yet more testing showed that compare insns too, were prone to catching
double-memory operands, for example with
c-c++-common/vector-compare-3.c -O2, from gcc.dg.  So, better try to
fix them, helping current and future optimization passes that are
reluctant or unable to operate on patterns with two memory operands.
This just happens at expansion time by hacking the force_reg stuff to
conveniently happen in the operand-massaging function
cris_reduce_compare.  Together, this and the two previous CRIS patches
did improve coremark results, but by a miniscule factor: speed by
0.002% (from 4887074 to 4886993 cycles) and size by 0.1% (code from
58199 to 58143 bytes) and as you can see, with rounding doing heavy
lifting.

* config/cris/cris.cc (cris_reduce_compare): Add forcing the first
operand to be a register, unless the second operand is 0, to scope.
* config/cris/cris.md ("*cstore<mode><code>4")
("*cbranch<mode><code>4"): Add guards to condition, for either operand
to be a register unless the last operand is zero.

4 months agoCRIS: For HI, QI, make sure move patterns don't have two memory operands
Hans-Peter Nilsson [Mon, 9 Feb 2026 20:30:46 +0000 (21:30 +0100)] 
CRIS: For HI, QI, make sure move patterns don't have two memory operands

Further testing showed that the two-memory-operands case that could
happen for movsf happened for the HI and QI modes as well, for example
in gcc.dg/Wrestrict-5.c.  So, for improved performance they'd better
get guards as well.  The movstrict<m> case is just tagging along for
summetry; I don't know of test-cases that expose that.

* config/cris/cris.md (BWDSF): New mode_iterator replacing SISF.
All callers changed.
("*movhi_internal<setcc><setnz><setnzvc>"): Anonymized from
"<acc><anz><anzvc>movhi<setcc><setnz><setnzvc>" to make it a
match-only pattern.  Add conditions to guard from source and
destination both being memory operands.
("*movstricthi_internal", "*movstrictqi_internal"): Similarly
for "movstricthi" and "movstrictqi".
("movstrict<mode>"): Add common expander for BW, forcing one operand
to be a register or source being zero.

4 months agoCRIS: Make sure movsf doesn't have two memory operands
Hans-Peter Nilsson [Thu, 5 Feb 2026 17:34:24 +0000 (18:34 +0100)] 
CRIS: Make sure movsf doesn't have two memory operands

Experimenting, I noticed movsf could get two memory operands, and
when the pass I was hacking, adjusted both operands, the rtl-ssa
framework didn't like the situation and signalled failure, for
example compiling gcc.c-torture/compile/pr85945.c.  While that's
arguably a wart in rtl-ssa and may be a problem by itself, this
shouldn't happen: one operand should be either a register or
constant 0.  It usually doesn't matter because RA fixes up
operands per the constraints.  Still, this is low-handing fruit
for improved performance, letting the RTL passes work on more
correct information ...and also, a plausible excuse for not also
hacking rtl-ssa proper.  Either way, the port is responsible for
guarding operand validity, so tweak it.  Incidental observation:
the two-memory-operands case happened already at expand time.
This mem-to-mem situation doesn't happen for movsi, because it has
special precautions to keep one operand a register or const_int 0,
which were added for reasons of condition-code handling.  That
particular condition, checking for REG_P or the subreg being REG_P
looks too restrictive though, not allowing the (subreg mem) case
that register_operand deliberately allows.

* config/cris/cris.md (SISF): New mode_iterator for SI and SF.
("mov<mode>"): Make "movsi" a define_expand to include SFmode by
means of the SISF iterator and adjust to also handle SFmode.
("*movsf_internal"): Anonymize "movsf"; make it a match-only pattern.
Add conditions to guard from source and destination both being memory
operands.

4 months agoopenmp: Allocate memory for private/firstprivate clauses as directed by allocate...
Kwok Cheung Yeung [Thu, 12 Feb 2026 14:48:03 +0000 (14:48 +0000)] 
openmp: Allocate memory for private/firstprivate clauses as directed by allocate clauses in target constructs [PR113436]

This patch generates calls to GOMP_alloc to allocate memory for firstprivate
and private clauses on target constructs with an allocator and alignment
as specified by the allocate clause.

The decl values of the clause need to be adjusted to refer to the allocated
memory, and the initial values of variables need to be copied into the
allocated space for firstprivate variables.

For variable-length arrays, the size of the array is stored in a separate
variable, so the allocation and initialization need to be delayed until the
size is made available on the target.

gcc/

PR middle-end/113436
* omp-low.cc (is_variable_sized): Add extra is_ref argument.  Check
referenced type if true.
(lower_omp_target): Call lower_private_allocate to generate code to
allocate memory for firstprivate/private clauses with allocators, and
insert code after dependent variables have been initialized.
Construct calls to free allocate memory and insert after target block.
Adjust decl values for clause variables.  Copy value of firstprivate
variables to allocated memory.

gcc/testsuite/

PR middle-end/113436
* c-c++-common/gomp/pr113436-1.c: New.
* c-c++-common/gomp/pr113436-2.c: New.
* g++.dg/gomp/pr113436.C: New.
* gfortran.dg/gomp/pr113436-1.f90: New.
* gfortran.dg/gomp/pr113436-2.f90: New.
* gfortran.dg/gomp/pr113436-3.f90: New.
* gfortran.dg/gomp/pr113436-4.f90: New.

libgomp/

PR middle-end/113436
* libgomp.texi (OpenMP 5.0): Mark allocate clause as implemented.
(Memory allocation): Add documentation for use in target construct.
* testsuite/libgomp.c++/firstprivate-1.C: Enable alignment check.
* testsuite/libgomp.c++/pr113436-1.C: New.
* testsuite/libgomp.c++/pr113436-2.C: New.
* testsuite/libgomp.c++/private-1.C: Enable alignment check.
* testsuite/libgomp.c-c++-common/pr113436-1.c: New.
* testsuite/libgomp.c-c++-common/pr113436-2.c: New.
* testsuite/libgomp.fortran/pr113436-1.f90: New.
* testsuite/libgomp.fortran/pr113436-2.f90: New.

4 months agocobol: Repair CALL ... USING BY VALUE.
Robert Dubner [Thu, 12 Feb 2026 16:11:51 +0000 (11:11 -0500)] 
cobol: Repair CALL ... USING BY VALUE.

These changes cause CALL ... USING BY VALUE to work properly for a
wider range of COBOL variables types, values, and sizes.  Some sizes
of numeric-display variables didn't work, some didn't work for negative
values, and floating-extended didn't work at all.  Now they do.

Fourteen new DejaGnu tests cover this repaired capability.

gcc/cobol/ChangeLog:

* genapi.cc (establish_using): Use a 128-bit type for
float-extended; handle numeric-edited values of different sizes
and signs correctly.
(create_and_call):  Use a 128-bit type for float-extended.

libgcobol/ChangeLog:

* Makefile.am: Temporarily continue to use -fno-strict-aliasing.
* Makefile.in: Likewise.
* libgcobol.cc (__gg__fetch_call_by_value_value): Simplify handling
of FldFloat.
(__gg__assign_value_from_stack): Likewise.
(__gg__unstring): Avoid uninitialized variable error.
(__gg__look_at_int128): New function useful for debugging.
(__gg__look_at_pointer): Likewise.
* xmlparse.cc (xml_event): Implement namespace XML.
(cdataBlock): Likewise.
(characters): Likewise.
(__gg__xml_parse):  Likewise.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/USING_COMP-3_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_COMP-3_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_COMP-3_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_COMP-3_BY_VALUE.out: New test.
* cobol.dg/group2/USING_FLOAT-SLX_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_FLOAT-SLX_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_FLOAT-SLX_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_FLOAT-SLX_BY_VALUE.out: New test.
* cobol.dg/group2/USING_NumericDisplay_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_NumericDisplay_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_NumericDisplay_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_NumericDisplay_BY_VALUE.out: New test.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_VALUE.out: New test.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_VALUE.out: New test.
* cobol.dg/group2/USING_Signed___COMP-3_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_Signed___COMP-3_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_Signed___COMP-3_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_Signed___COMP-3_BY_VALUE.out: New test.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_REFERENCE.cob: New test.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_REFERENCE.out: New test.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_VALUE.cob: New test.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_VALUE.out: New test.

4 months agolibitm: Fix recent libitm testsuite regression [PR69018]
Pietro Monteiro [Wed, 11 Feb 2026 16:55:13 +0000 (11:55 -0500)] 
libitm: Fix recent libitm testsuite regression [PR69018]

The commit r16-7202-gb129ff0880c6d1 broke running libitm’s testsuite
using combinations of options because it didn’t clean up all the
global variables set in c++.exp.  Fix the regression by using g++ for
the C++ tests and cleaning up the variables shared between C and C++
tests.

libitm/ChangeLog:
PR libitm/69018
* testsuite/lib/libitm.exp (libitm_init): Check
GXX_UNDER_TEST.  Add "${blddir}/.libs" to
always_ld_library_path if blddir is not empty.  Use
"-fdiagnostics-plain-output".  Don't set compiler to GCC_UNDER_TEST.
* testsuite/libitm.c++/c++.exp: If $blddir is not empty set
libstdc++_library_path, shlib_ext, lang_include_flags, add
"${blddir}/${lang_library_paths}" to ld_library_path.
Unset libstdc++_library_path and shlib_ext if we skip C++
tests and at the end of the test run.
* testsuite/libitm.c/c.exp: Update the FSF address to the
website in the license text. Unset lang_library_paths and
lang_include_flags.  Set the compiler to $GCC_UNDER_TEST.

Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
4 months agolibiberty: Preserve `errno` across calls to `libiberty_vprintf_buffer_size()`
LIU Hao [Mon, 9 Feb 2026 13:44:07 +0000 (21:44 +0800)] 
libiberty: Preserve `errno` across calls to `libiberty_vprintf_buffer_size()`

The MSVCRT `strtoul()` function resets `errno` to zero upon success. On such
a system, `libiberty_vprintf_buffer_size()` could clobber `errno` like this:

   MINGW64 ~
   $ ld nonexistent.file
   C:\MSYS64\mingw64\bin\ld.exe: cannot find nonexistent.file: No error

libiberty/ChangeLog:

* vprintf-support.c (do_strtoul): New function.
(libiberty_vprintf_buffer_size): Replace `strtoul` with `do_strtoul`.

Signed-off-by: LIU Hao <lh_mouse@126.com>
4 months agoMove gcc.dg/vect/vec-scal-*.c and simplify globbing of the rest
Richard Biener [Thu, 12 Feb 2026 10:08:53 +0000 (11:08 +0100)] 
Move gcc.dg/vect/vec-scal-*.c and simplify globbing of the rest

The following creates a subdirectory gcc.dg/vect/veclower/ and moves
the vector lowering tests vec-scal-*.c there.  This simplifies
globbing of gcc.dg/vect/ testcases, partitioning them into
bb-slp-*.c and non-bb-slp-*.c sets.  I needed to rename bb-slp
files in complex/ and skip templates that are just included there.

* gcc.dg/vect/vect.exp: Adjust vec-scal-*.c glob.  Merge
globbing of non-bb-slp-*.c tests to a *.c glob excluding
bb-slp-*.c.
* gcc.dg/vect/vec-scal-opt.c: Move ...
* gcc.dg/vect/veclower/vec-scal-opt.c: ... here.
* gcc.dg/vect/vec-scal-opt1.c: Move ...
* gcc.dg/vect/veclower/vec-scal-opt1.c: ... here.
* gcc.dg/vect/vec-scal-opt2.c: Move ...
* gcc.dg/vect/veclower/vec-scal-opt2.c: ... here.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-double.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-half-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-half-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-double.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-double.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-half-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mla-double.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mla-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-half-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mla-half-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mls-double.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mls-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-half-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mls-half-float.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mul-double.c: ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mul-float.c : ... this.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-half-float.c: Rename to ...
* gcc.dg/vect/complex/bb-slp-complex-mul-half-float.c: ... this.
* gcc.dg/vect/complex/complex-add-pattern-template.c: Skip.
* gcc.dg/vect/complex/complex-add-template.c: Skip.
* gcc.dg/vect/complex/complex-mla-template.c: Skip.
* gcc.dg/vect/complex/complex-mls-template.c: Skip.
* gcc.dg/vect/complex/complex-mul-template.c: Skip.
* gcc.dg/vect/complex/complex-operations.c: Skip.

4 months agoc++: missing type-only context [PR124045]
Marek Polacek [Wed, 11 Feb 2026 20:58:46 +0000 (15:58 -0500)] 
c++: missing type-only context [PR124045]

[temp.res.general]/4.4.1 says that a decl-specifier of the
decl-specifier-seq of a simple-declaration in namespace scope is
a type-only context.  I think this goes back to P0634R3.  So

  [: ^^int :] a = 42;

shouldn't require a 'typename' when in a namespace scope.

The _diagnose_invalid_type_name change is so that we don't emit extra

  error: '<expression error>' in '...' does not name a type

in concepts-return-req4.C, variadic74.C, and variadic-nested3.C.

PR c++/124045

gcc/cp/ChangeLog:

* parser.cc (cp_parser_parse_and_diagnose_invalid_type_name): Also
abort the tentative parse when id is error_mark_node.
(cp_parser_simple_declaration): Set CP_PARSER_FLAGS_TYPENAME_OPTIONAL
when in a namespace scope.
(cp_parser_single_declaration): Use cp_parser_flags instead of int.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/type1.C: Don't expect an error for a missing typename
in a namespace scope.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agoalgol68: Fix assignment of union overhead values [PR algol68/124049]
James Bohl [Thu, 12 Feb 2026 03:42:20 +0000 (22:42 -0500)] 
algol68: Fix assignment of union overhead values [PR algol68/124049]

This patch sorts union packs in the a68-parser function so that
equivalent unions defined in different packets are assigned the same
mapping of mode to overhead value.

Signed-off-by: James Bohl <bohlj47@gmail.com>
gcc/algol68/ChangeLog

PR algol68/124049
* Make-lang.in (ALGOL68_OBJS): Add algol68/a68-moids-sorting.o.
* a68.h: Add prototype for a68_sort_union_packs.
* a68-moids-sorting.cc: New file.
* a68-parser-modes.cc (a68_make_moid_list): Call a68_sort_union_packs.
* ga68-exports.pk (ga68_mode_64): Add comment on union mode ordering.

gcc/testsuite/ChangeLog

PR algol68/124049
* algol68/execute/modules/program-25.a68: New test.
* algol68/execute/modules/module25a.a68: New file.
* algol68/execute/modules/module25b.a68: New file.

4 months agoifcvt: Fix rtl checking due to reversed_comparison_code returning UNKNOWN [PR124062]
Andrew Pinski [Wed, 11 Feb 2026 21:24:04 +0000 (13:24 -0800)] 
ifcvt: Fix rtl checking due to reversed_comparison_code returning UNKNOWN [PR124062]

This was an oversight on my part (after r16-6435-g594f2cbf30f0a3)
where I forgot that sometimes reversed_comparison_code will return
UNKNOWN when the floating point comparison can't be reversed.
This seems only to show up with RTL checking only; at least as far
as I can tell because it is rejected later on but I could be wrong.

Bootstrapped and tested on x86_64-linux-gnu.

PR rtl-optimization/124062

gcc/ChangeLog:

* ifcvt.cc (noce_try_cond_arith): Check the conditional code
for UNKNOWN.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 months agoaarch64: Fix ICE in JSON tuning schema with dispatch scheduling and update schema...
Soumya AR [Tue, 10 Feb 2026 08:58:47 +0000 (08:58 +0000)] 
aarch64: Fix ICE in JSON tuning schema with dispatch scheduling and update schema for SVE costs.

This patch fixes the following bugs:

1) For SVE vector costs [sve_vec_cost], the JSON schema did not list the
inherited members from the base structure, only the SVE specific ones. Updated
the schema to include all the members and regenerated the printing/parsing
routines.

2) After dispatch scheduling, if someone uses -fdump-tuning-model with
mcpu=olympus, it will have the flag for dispatch scheduling enabled. Then, if
someone uses that dump against any -mcpu other than Olympus for tuning, it will
ICE as we enable dispatch scheduling but don't provide the data. Updated this
to clear the flag if dispatch_constraints is NULL.

Signed-off-by: Soumya AR <soumyaa@nvidia.com>
gcc/ChangeLog:

* config/aarch64/aarch64-json-schema.h: Include inherited members for
SVE vector costs.
* config/aarch64/aarch64-json-tunings-parser-generated.inc
(parse_vec_costs_sve): Regenerate.
* config/aarch64/aarch64-json-tunings-parser.cc
(aarch64_load_tuning_params_from_json_string): Clear dispatch scheduling
flag if dispatch_constraints is NULL.
* config/aarch64/aarch64-json-tunings-printer-generated.inc
(serialize_vec_costs_sve): Regenerate.

4 months agoc++: relax ref-qual overloading rules for C++20 [PR98939]
Patrick Palka [Thu, 12 Feb 2026 02:35:35 +0000 (21:35 -0500)] 
c++: relax ref-qual overloading rules for C++20 [PR98939]

As explained in one of Tomasz's library papers P2438R2[1], C++20 allows
ref-qualified member overloads to coexist with non-ref-qualified ones,
but at the time of writing no compiler supported that.  This patch
implements this C++20 relaxation so that we can in turn implement
P2438R2 as originally intended -- without needing to change the
signature of the main string::substr overload.

[1]: https://wg21.link/P2438R2#_modifying_existing_const_overload

PR c++/98939
PR libstdc++/119745

gcc/cp/ChangeLog:

* class.cc (object_parms_correspond): Allow differing
FUNCTION_REF_QUALIFIED in C++20.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/ref-qual5.C: Expect no diagnostics in C++20.

Reviewed-by: Jason Merrill <jason@redhat.com>
4 months agolibstdc++: Clear padding bits in std::atomic ctor in C++11 [PR114865]
Patrick Palka [Thu, 12 Feb 2026 02:35:21 +0000 (21:35 -0500)] 
libstdc++: Clear padding bits in std::atomic ctor in C++11 [PR114865]

After the front end change r16-7199 both GCC and Clang allow non-empty
constexpr constructor bodies in C++11 as an extension, so we can now
unconditionally enable the __builtin_clear_padding logic in std::atomic's
constructor.

PR libstdc++/114865

libstdc++-v3/ChangeLog:

* include/std/atomic (atomic<_Tp>::atomic(_Tp)) [C++11]:
Enable __builtin_clear_padding logic.
* testsuite/29_atomics/atomic/compare_exchange_padding.cc: Enable
this test in earlier modes, including C++11.
* testsuite/29_atomics/atomic/cons/zero_padding.cc [C++11]:
Enable tests verifying cleared padding bits for a non-static-init
std::atomic object.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
4 months agoanalyzer: fix false +ve buffer overflow on sprintf [PR117369]
David Malcolm [Thu, 12 Feb 2026 01:49:44 +0000 (20:49 -0500)] 
analyzer: fix false +ve buffer overflow on sprintf [PR117369]

gcc/analyzer/ChangeLog:
PR analyzer/117369
* kf.cc (kf_sprintf::impl_call_pre): Use the capacity of the
region when "faking" a write to the destination buffer, to
avoid buffer overflow false +ves.

gcc/testsuite/ChangeLog:
PR analyzer/117369
* c-c++-common/analyzer/sprintf-pr117369.c: New test.
* gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: Update expected
results to reflect complexity limits being hit earlier.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agotestsuite: add regression test for analyzer ICE [PR111099]
David Malcolm [Thu, 12 Feb 2026 01:49:44 +0000 (20:49 -0500)] 
testsuite: add regression test for analyzer ICE [PR111099]

The ICE in PR analyzer/111099 seems to have been fixed on trunk by
r16-6063-g0b786d961d4426.  Add a regression test for it.

gcc/testsuite/ChangeLog:
PR analyzer/111099
* gcc.dg/analyzer/torture/ice-pr111099.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoanalyzer: fix ICE in push_frame with missing return statement [PR124073]
David Malcolm [Thu, 12 Feb 2026 01:49:43 +0000 (20:49 -0500)] 
analyzer: fix ICE in push_frame with missing return statement [PR124073]

gcc/analyzer/ChangeLog:
PR analyzer/124073
* region-model.cc (region_model::push_frame): Bulletproof against
DECL_RESULT having null SSA on function missing a return
statement (-Wreturn-type).

gcc/testsuite/ChangeLog:
PR analyzer/124073
* g++.dg/analyzer/ice-pr124073.C: New test.

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

4 months agotestsuite: Use color=never for more sanitizer tests
Joseph Myers [Wed, 11 Feb 2026 23:53:41 +0000 (23:53 +0000)] 
testsuite: Use color=never for more sanitizer tests

The sanitizer tests have logic to set ASAN_OPTIONS and UBSAN_OPTIONS
to color=never to avoid problems checking against output patterns, in
test configurations where the output is otherwise coloured by default.

This does not however cover all sanitizer tests with issues in such
configurations.  There is no corresponding logic to set TSAN_OPTIONS
for tsan tests, and environment variable settings in
dg-set-target-env-var override the globally set color=never.

Add logic to set TSAN_OPTIONS similarly (following the UBSAN_OPTIONS
logic, that saves and restores any previous setting or lack thereof,
rather than the ASAN_OPTIONS logic, that just sets ASAN_OPTIONS in the
environment so that it remains set for all the rest of the possibly
unrelated tests included in the same runtest execution).  Also add
color=never to dg-set-target-env-var in two such tests where I've seen
coloured output causing failures (but not for other tests where I
haven't seen the default producing such fallures).

Tested for x86_64-pc-linux-gnu, and with a cross to aarch64-linux
(together with other testsuite fixes) in a configuration where I
previously saw failures related to colour output from sanitizer tests.

* lib/tsan-dg.exp (orig_tsan_options_saved, orig_tsan_options):
New global variables.
(tsan_init): Save TSAN_OPTIONS and set it to color=never.
(tsan_finish): Restore TSAN_OPTIONS.
* c-c++-common/asan/pr64820.c: Include color=never in
ASAN_OPTIONS.
* c-c++-common/asan/use-after-return-1.c: Likewise.

4 months agoa68: add coding guideline on enquiry clauses
Jose E. Marchesi [Wed, 11 Feb 2026 22:03:44 +0000 (23:03 +0100)] 
a68: add coding guideline on enquiry clauses

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

* ga68-coding-guidelines.texi (Enquiry clauses): New section.

4 months ago[PR121191, LRA]: Check int modes to generate the right subreg offset when matching...
Vladimir N. Makarov [Wed, 11 Feb 2026 18:46:34 +0000 (13:46 -0500)] 
[PR121191, LRA]: Check int modes to generate the right subreg offset when matching reload regs of different modes

In the PR test case (gcc.c-torture/compile/pr35318.c), LRA chose to
match operands in DFmode and SImode modes.  On big endian targets,
this resulted in wrong subreg offset generation and wrong insn
generation.  The offset would be right if the both operands were
scalar integers (see call of reload.cc:operands_match_p in
recog.cc:constrain_operands).  The patch solves the problem.

gcc/ChangeLog:

PR rtl-optimization/121191
* lra-constraints.cc (get_matching_reload_reg_subreg): New.
(get_reload_reg, match_reload): Use it.

4 months agoMake gcc.dg/vect/bb-slp-cond-1.c PASS with -mavx2
Richard Biener [Wed, 11 Feb 2026 17:31:45 +0000 (18:31 +0100)] 
Make gcc.dg/vect/bb-slp-cond-1.c PASS with -mavx2

This fixes the testcase to avoid epilogue vectorization.

* gcc.dg/vect/bb-slp-cond-1.c: Disable epilogue vectorization.

4 months agolibstdc++: Make function_ref non-dangling for stateless wrappers
Tomasz Kamiński [Mon, 2 Feb 2026 09:19:51 +0000 (10:19 +0100)] 
libstdc++: Make function_ref non-dangling for stateless wrappers

This patch makes the function_ref non-dangling for the stateless
wrappers:
* any functor for which operator() selected for arguments is static,
* standard functors, including pre-C++20 ones.
In other words, any function_ref fr, that is constructed from stateless
wrapper w, can be still called after the object w is destroyed, e.g.:
  std::function_ref<bool(int, int)> fr(std::ranges::less{});
  fr(1, 2); // OK, previously UB because fr referred to already destroyed
            // temporary
As function_ref's operator() is not constexpr, we test the change by checking
if the above declaration can be made constexpr, as such variable cannot contain
dangling pointer values.

We adjust the function_ref generic constructor from any functor, to use more
specialized invoker:
* _S_static (newly added) if the called operator() overload is static,
  after changes r16-5624-g0ea9d760fbf44c, this covers all post-c++20 functors;
* _S_nttp<_Fd{}> for pre-C++20 standard functors.
In both above cases the value of _M_ptrs is ignored and simply set to nullptr.

This follows same technique (checking _Fd::operator()(args...)), and support
the same set of types, as for one used for the transform views iterators in
r16-5625-g9ed821d107f7a1.

As after this change we provide well-defined behavior for the code, that
previous was undefined, this changes is pure quality-of-implementation.
As illustrated by the test cases, it has observable side effects, where
non-longer dangling constructs can be used to define constexpr function_ref.
However, the standard does not define when the constructors defined constexpr
are actually usable at compile time, and the already have precedent in form
of SSO string for validity such constructs being implementation specific.

libstdc++-v3/ChangeLog:

* include/bits/funcref_impl.h (function_ref::function_ref(_Fn&&)):
Use _S_static and _S_nttp invokers.
* include/bits/funcwrap.h (_Base_invoker::_S_static):
Define.
* include/bits/stl_function.h (std::__is_std_op_template)
(std::__is_std_op_wrapper) [__cplusplus > 201703L]:
Moved from std/ranges.
* include/std/ranges (__detail::__is_std_op_template)
(__detail::__is_std_op_wrapper): Moved to bits/stl_function.h.
* testsuite/20_util/function_ref/dangling.cc: New test.
* testsuite/20_util/function_ref/dangling_neg.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agoAArch64: Add tests to ensure rev is produced
Chris Bazley [Wed, 11 Feb 2026 15:53:22 +0000 (15:53 +0000)] 
AArch64: Add tests to ensure rev is produced

If the compiler mistakenly vectorizes byte order reversal
then the resultant code is inevitably less efficient than a
rev instruction.  This kind of error will become more likely if
SVE predication is ever used to vectorize smaller groups
than could be vectorized using ASIMD instructions.  Add tests to
guard against future regressions.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/rev_32_1.c: New test.
* gcc.target/aarch64/rev_32_2.c: New test.
* gcc.target/aarch64/rev_32_3.c: New test

4 months agolibstdc++: Add test for atomic with padding on heap [PR123875]
Tomasz Kamiński [Wed, 11 Feb 2026 14:05:00 +0000 (15:05 +0100)] 
libstdc++: Add test for atomic with padding on heap [PR123875]

C++26 makes the values of uninitialized stack object erroneous,
de-facto requiring their initialization, so adding a test for
variable on heap.

PR libstdc++/123875

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/atomic/cons/static_zero_padding.cc: Move to...
* testsuite/29_atomics/atomic/cons/zero_padding.cc: ...here and
added heap tests. Also fixed trailing whitespaces.

4 months agoanalyzer: fix uninit in null-termination checking [PR124055]
David Malcolm [Wed, 11 Feb 2026 13:51:16 +0000 (08:51 -0500)] 
analyzer: fix uninit in null-termination checking [PR124055]

gcc/analyzer/ChangeLog:
PR analyzer/124055
* kf.cc (kf_strcpy::impl_call_pre): Ensure bytes_to_copy is
initialized.  Assert that it was written to with non-null if
check_for_null_terminated_string_arg returns non-null.
* region-model.cc (region_model::scan_for_null_terminator):
Initialize *out_sval, and assert it is written to when
returning non-null.
(region_model::check_for_null_terminated_string_arg): Assert
that scan_for_null_terminator wrote to *out_sval if it
returns non-null.

gcc/testsuite/ChangeLog:
PR analyzer/124055
* gcc.dg/analyzer/ice-pr124055-1.c: New test.
* gcc.dg/analyzer/ice-pr124055-2.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoanalyzer: fold X + (Y - X) to Y [PR123973]
David Malcolm [Wed, 11 Feb 2026 13:51:16 +0000 (08:51 -0500)] 
analyzer: fold X + (Y - X) to Y [PR123973]

gcc/analyzer/ChangeLog:
PR analyzer/123973
* region-model-manager.cc
(region_model_manager::maybe_fold_binop): Fold X + (Y - X) to Y.

gcc/testsuite/ChangeLog:
PR analyzer/123973
* c-c++-common/analyzer/infinite-recursion-pr123973.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agolibstdc++: Add missing exports for std::call_once on Windows [PR123908]
Jonathan Wakely [Wed, 11 Feb 2026 13:05:18 +0000 (13:05 +0000)] 
libstdc++: Add missing exports for std::call_once on Windows [PR123908]

libstdc++-v3/ChangeLog:

PR libstdc++/123908
* config/abi/pre/gnu.ver (GLIBCXX_3.4.35): Add exports for
std::__get_once_callable and std::__get_once_call.

4 months agoUse dg-additional-options in vect.exp, simplify file globbing
Richard Biener [Wed, 11 Feb 2026 08:50:55 +0000 (09:50 +0100)] 
Use dg-additional-options in vect.exp, simplify file globbing

This makes use of dg-additional-options for the remainder of tests
that were still getting those by filename based rules.  This moves
all those under the vect option iteration and slightly simplifies
globbing by moving some files.  I've kept the the veclower test glob.
IMO remaining simplification either needs mass renaming of files or/and moving
them into subdirectories.  Possibly some regex or TCL expert can
figure out how to filter bb-slp-*.c and vec-scal-*.c from everything
else that's now catched by 17 inclusive regexp.

* gcc.dg/vect/vect.exp: Remove remaining filename based
testcase options in favor of dg-additional-options.
* gcc.dg/vect/O-pr46167.c: Use dg-additional-options.
* gcc.dg/vect/O1-pr33854.c: Likewise.
* gcc.dg/vect/O1-pr41008.c: Likewise.
* gcc.dg/vect/Os-vect-95.c: Likewise.
* gcc.dg/vect/ggc-pr37574.c: Likewise.
* gcc.dg/vect/no-fre-pre-pr50208.c: Likewise.
* gcc.dg/vect/no-tree-dom-vect-bug.c: Likewise.
* gcc.dg/vect/no-tree-fre-pr50039.c: Likewise.
* gcc.dg/vect/no-tree-pre-pr45241.c: Likewise.
* gcc.dg/vect/no-tree-pre-slp-29.c: Likewise.
* gcc.dg/vect/unswitch-loops-pr26969.c: Likewise.
* gcc.dg/vect/O3-pr36098.c: Likewise.
* gcc.dg/vect/O3-pr39675-2.c: Likewise.
* gcc.dg/vect/O3-pr41881.c: Likewise.
* gcc.dg/vect/O3-pr45971.c: Likewise.
* gcc.dg/vect/O3-pr46077.c: Likewise.
* gcc.dg/vect/O3-pr49087.c: Likewise.
* gcc.dg/vect/O3-pr70130.c: Likewise.
* gcc.dg/vect/O3-pr85794.c: Likewise.
* gcc.dg/vect/O3-pr87546.c: Likewise.
* gcc.dg/vect/O3-slp-reduc-10.c: Likewise.
* gcc.dg/vect/O3-vect-pr32243.c: Likewise.
* gcc.dg/vect/O3-vect-pr34223.c: Likewise.
* gcc.dg/vect/O3-vect-pr61917.c: Likewise.
* gcc.dg/vect/aligned-section-anchors-nest-1.c: Likewise.
* gcc.dg/vect/aligned-section-anchors-vect-70.c: Likewise.
* gcc.dg/vect/aligned-section-anchors-vect-71.c: Likewise.
* gcc.dg/vect/aligned-section-anchors-vect-72.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-outer-1.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-outer-2.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-outer-3.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-outer-4.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-outer-5.c: Likewise.
* gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-1.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-10.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-10a.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-10b.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-11.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-12.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-13.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-14.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-15.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-16.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-17.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-18.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-19.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-2.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-20.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-21.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-22.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-3.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-4.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-5.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-6-global.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-6.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-7.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-8.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-9.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-9a.c: Likewise.
* gcc.dg/vect/no-scevccp-outer-9b.c: Likewise.
* gcc.dg/vect/no-scevccp-pr49199.c: Likewise.
* gcc.dg/vect/no-scevccp-pr86725-1.c: Likewise.
* gcc.dg/vect/no-scevccp-pr86725-2.c: Likewise.
* gcc.dg/vect/no-scevccp-pr86725-3.c: Likewise.
* gcc.dg/vect/no-scevccp-pr86725-4.c: Likewise.
* gcc.dg/vect/no-scevccp-pr86725-5.c: Likewise.
* gcc.dg/vect/no-scevccp-slp-30.c: Likewise.
* gcc.dg/vect/no-scevccp-slp-31.c: Likewise.
* gcc.dg/vect/no-scevccp-vect-iv-1.c: Likewise.
* gcc.dg/vect/no-scevccp-vect-iv-2.c: Likewise.
* gcc.dg/vect/no-scevccp-vect-iv-3.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-31.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-34.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-36.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-64.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-65.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-66.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-68.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-69.c: Likewise.
* gcc.dg/vect/no-section-anchors-vect-outer-4h.c: Likewise.
* gcc.dg/vect/no-trapping-math-1.c: Likewise.
* gcc.dg/vect/no-trapping-math-2.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-111.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c: Likewise.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c: Likewise.
* gcc.dg/vect/section-anchors-pr27770.c: Likewise.
* gcc.dg/vect/section-anchors-vect-69.c: Likewise.
* gcc.dg/vect/no-tree-reassoc-bb-slp-12.c: Rename to ...
* gcc.dg/vect/bb-slp-12.c: ... this.  Use dg-additional-options.
* gcc.dg/vect/fast-math-bb-slp-call-1.c: Rename to ...
* gcc.dg/vect/bb-slp-call-1.c: ... this.
* gcc.dg/vect/fast-math-bb-slp-call-2.c: Rename to ...
* gcc.dg/vect/bb-slp-call-2.c: ... this.
* gcc.dg/vect/fast-math-bb-slp-call-3.c: Rename to ...
* gcc.dg/vect/bb-slp-call-3.c: ... this.
* gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c: Rename to ...
* gcc.dg/vect/bb-slp-pr50730.c: ... this.  Use dg-additional-options.

4 months agoAda: Rework implementation of Ada.Containers.Bounded_Indefinite_Holders
Steve Baird [Wed, 11 Feb 2026 12:04:20 +0000 (13:04 +0100)] 
Ada: Rework implementation of Ada.Containers.Bounded_Indefinite_Holders

In particular, this adds support for the case where the Element_Type actual
parameter is a class-wide type.

gcc/ada/
PR ada/124016
* doc/gnat_rm/implementation_defined_attributes.rst: Document
that Finalization_Size attribute is defined for class-wide types.
* exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
Add support for class-wide types.
<Size>: Raise Constraint_Error for class-wide types.
* exp_imgv.adb (Expand_Image_Attribute): Adjust call to renaming.
(Expand_Wide_Image_Attribute): Likewise.
(Expand_Wide_Wide_Image_Attribute): Likewise.
* sem_attr.ads (Finalization_Size): Update comment.
* sem_attr.adb (Analyze_Image): Adjust call to renaming.
(Analyze_Attribute): Remove check disallowing Finalization_Size
attribute for class-wide types.
* sem_util.ads (Is_Object_Image): Rename into...
(Is_Object_Prefix): ...this.
* sem_util.adb (Is_Object_Image): Rename into...
(Is_Object_Prefix): ...this.
* libgnat/a-cbinho.ads (Extra_Storage): Use Descriptor_Size and
Finalization_Size attributes.
(Max_Allocation_Overhead_In_Storage_Elements): Delete.

4 months agomiddle-end: partially revert fix for PR123898 after fix for PR123940 [PR124038]
Tamar Christina [Wed, 11 Feb 2026 11:36:50 +0000 (11:36 +0000)] 
middle-end: partially revert fix for PR123898 after fix for PR123940 [PR124038]

There were two mutually incompatible changes reviewed and
merged around the same time for different issues in
convert_mult_to_fma.

the change in r16-7353 keeps result in it's unpromoted form
and deals with it as such but the change in r16-7304 expects
it to be in it's promoted form.

This causes the assert to fail again and the SVE testcase I
added before to fail.

Since the value is now kept in it's unpromoted form, and result
is not used as any LHS side, I've partially reverted the
convert stripping to make use of it.

gcc/ChangeLog:

PR tree-optimization/124038
* tree-ssa-math-opts.cc (strip_nop_view_converts): Remove.
(convert_mult_to_fma): Undo stripping.

gcc/testsuite/ChangeLog:

PR tree-optimization/124038
* gcc.target/riscv/rvv/pr124038.c: New test.

4 months agoAda: Fix internal error on access attribute used as subpool in allocator
Eric Botcazou [Wed, 11 Feb 2026 10:38:24 +0000 (11:38 +0100)] 
Ada: Fix internal error on access attribute used as subpool in allocator

This is a regression present for quite a long time: the compiler aborts
on an allocator whose subpool name is an access attribute and when an
allocation procedure must be generated, for example when the allocation
is controlled.

The fix is to do what is done elsewhere in Build_Allocate_Deallocate_Proc,
that is to say pass the allocation procedure as the new scope in the call
to the New_Copy_Tree function.

gcc/ada/
PR ada/124054
* exp_util.adb (Build_Allocate_Deallocate_Proc): Tidy up and pass
Proc_Id as the new scope in the call to the New_Copy_Tree function.

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

Co-authored-by: Liam Powell <liam@liampwll.com>
4 months agoMake some C++ tests account for llp64 targets
Jonathan Yong [Wed, 11 Feb 2026 05:49:57 +0000 (05:49 +0000)] 
Make some C++ tests account for llp64 targets

Fix spurious warnings with mingw-w64.

gcc/testsuite/ChangeLog:

* g++.dg/expr/cast11.C: Cast to intptr_t instead of long.
* g++.dg/opt/pr55717.C: Ditto.
* g++.dg/warn/Wunused-value-1.C: Ditto.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
4 months agolibstdc++: Optimize std::regex_traits lookup functions
Jonathan Wakely [Tue, 10 Feb 2026 20:04:28 +0000 (20:04 +0000)] 
libstdc++: Optimize std::regex_traits lookup functions

Optimize regex_traits::lookup_collatename and
regex_traits::lookup_classname.

For lookup_collatename we can hoist the static array into a
non-dependent function, then call that for the regex_traits<char>
specialization without performing any narrowing operations via the ctype
facet. For the regex_traits<wchar_t> specialization we populate a
std::string for the narrowed result, and call the non-dependent function.

For lookup_classname we can avoid the static array entirely, replacing
the iteration over that array with a nested switch that implements a
kind of manually-unrolled trie, only match one char at a time until we
either match a full string or get a mismatch. This avoids narrowing the
entire input and storing it in a temporary string. This improves
performance by 2-3x for -O2 and below (the benefit is much smaller for
-O3).

We can also check the input length for random access iterators, and
reject any strings longer than "xdigit" without doing any work at all.
For silly cases like [:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:]
this gives a 100x improvement.

libstdc++-v3/ChangeLog:

* include/bits/regex.tcc (__detail::__lookup_collatename): New
function.
(regex_traits::lookup_collatename): Use new function. Elide
redundant narrowing via ctype facet for regex_traits<char>.
(regex_traits::lookup_classname): Replace lookup table with
handwritten prefix match.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agolibstdc++: Fix std::regex_traits::lookup_classname [PR124015]
Jonathan Wakely [Thu, 5 Feb 2026 17:32:23 +0000 (17:32 +0000)] 
libstdc++: Fix std::regex_traits::lookup_classname [PR124015]

This fixes a bug in regex_traits::lookup_classname(f, l, true) where the
result was always ctype_base::alpha for any input sequence [f, l) that
has the ctype_base::lower or ctype_base::upper bits set. For targets
that define alpha as lower|upper (rather than having a distinct bit for
alpha) this bug meant that all masks which have lower or upper bits set
were replaced with alpha when the icase parameter is true. This has the
effect that trying to do a case insensitive match for [:alnum:],
[:graph:], or [:print:] was equivalent to matching [:alpha:] instead,
which is obviously not correct.

Based on inspection of the ctype_base.h files under the config/os
directory, the bug appears to affect newlib, picolibc, qnx and vxworks.

libstdc++-v3/ChangeLog:

PR libstdc++/124015
* include/bits/regex.tcc (regex_traits::lookup_classname): Fix
handling of icase parameter.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agolibstdc++: Improve tests for std::regex_traits::lookup_classname [PR124015]
Jonathan Wakely [Tue, 10 Feb 2026 20:01:32 +0000 (20:01 +0000)] 
libstdc++: Improve tests for std::regex_traits::lookup_classname [PR124015]

libstdc++-v3/ChangeLog:

PR libstdc++/124015
* testsuite/28_regex/traits/char/lookup_classname.cc: Check for
correct result for unrecognized classname. Check that lookup is
case insensitive. Check that all required classnames are
recognized. Check that icase flag only affects "lower" and
"upper".
* testsuite/28_regex/traits/wchar_t/lookup_classname.cc:
Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agocfgexpand: Fix up "=@ccz" etc. outputs on asm goto [PR124056]
Jakub Jelinek [Wed, 11 Feb 2026 10:34:09 +0000 (11:34 +0100)] 
cfgexpand: Fix up "=@ccz" etc. outputs on asm goto [PR124056]

The following testcase is miscompiled, because after_md_seq which is
what is emitted for "=@cc?" outputs to initialize a pseudo with
the result is emitted just once, on the asm goto fallthru edge, before
after_rtl_seq (on that edge that is the correct ordering), but a copy
of after_rtl_seq is also emitted on the other edges from asm goto, but
after_md_seq is not.
So, the pseudo with the flags checking is initialized only in the
fallthru case and not when asm goto is left through one of the other
labels (unless those are degenerate).

The following patch arranges to emit that sequence duplicated on all the
edges before after_rtl_seq sequence, by modifying after_rtl_seq so that
it includes after_md_seq followed by the old after_rtl_seq.

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

PR middle-end/124056
* cfgexpand.cc (expand_asm_stmt): If after_md_seq is non-NULL, emit
it at the start of after_rtl_seq instead of after fallthru_label.

* gcc.target/i386/pr124056.c: New test.

4 months agocfgrtl: Fix up force_nonfallthru_and_redirect asm goto handling [PR123386]
Jakub Jelinek [Wed, 11 Feb 2026 10:31:26 +0000 (11:31 +0100)] 
cfgrtl: Fix up force_nonfallthru_and_redirect asm goto handling [PR123386]

force_nonfallthru_and_redirect has some extra code to handle asm gotos
if we are forcing or redirecting the EDGE_FALLTHRU in case.  This was
done for PR51767, PR53589, PR54127.
It is done for the cases where some asm goto label points to the bb
after the fallthru edge (i.e. there is edge sharing between the fallthru
and the label, partly or fully degenerate asm goto) and/or if the label
points to the TARGET bb (before/after).
In such case it changes the label from e->dest's label to target's label
and similarly to the case of 2+ successor e->src a new bb is created
as new fallthru from e->src and in the asm goto case an additional edge
is added, so there is
 |
asm goto -----+    maybe other edges
 | fallthru    \
 v              v
 jumpblock -> target
and the jumpblock -> target edge isn't EDGE_FALLTHRU.
This was done that way to fix various ICEs with the degenerate asm gotos,
see above for list.
I believe it will still ICE if we decide to force_nonfallthru_and_redirect
E bb5->bb6 to l2, because in that case there are already two+ edges, one
pointing from bb5->l2 and we create another edge bb5->l2:
bb5:
asm goto ("" : : : : (l2));
bb6:
...
l2:
but maybe nothing tries that in that case.  Anyway, the reason why
the following two (PR116600 and PR123386) testcases are miscompiled is
that we try to (during shrink-wrapping) emit some insns on the bb3->bb7
edge, and see bb7 predecessor edge is EDGE_FALLTHRU in:
bb3:
  __asm__ goto ("" : : : : d);
  if (c)
    bar (a);
bb6:
  __asm__ goto ("" : : : : d);
d: // == bb7
in rtl_split_edge:
  /* We are going to place the new block in front of edge destination.
     Avoid existence of fallthru predecessors.  */
  if ((edge_in->flags & EDGE_FALLTHRU) == 0)
    {
      edge e = find_fallthru_edge (edge_in->dest->preds);

      if (e)
        force_nonfallthru (e);
    }
Now, the asm goto in bb6 is degenerate, so shrink-wrapping isn't aware
that there would be multiple edges from it, there is just single one.
But we still while splitting the bb3->bb7 edge in order to emit there
pending insns on that edge turn the single successor asm goto bb into
one with two successors (initially with two different ways to reach
the same destination).  But unfortunately such change confuses the
shrink-wrapping logic which isn't aware of such a change and so the
separate shrink wrapping insns end up just on one of the paths instead
of being on both, and we then ICE in dwarf2 pass because there is an
disagreement on the CFI state (of course it is a wrong-code too).

Note, force_nonfallthru calls force_nonfallthru_and_redirect with
target set to e->dest.

The following patch reworks this.
Instead of creating that
 |
asm goto -----+    maybe other edges
 | fallthru    \
 v              v
 jumpblock -> target
for initially degenerate asm goto we now create
 |
asm goto    maybe other edges
 | fallthru
 v
 jumpblock -> target
i.e. the asm goto keeps being degenerate, all we've changed is adding
a new bb on the fallthru edge and making the edge from that new bb
non-fallthru.  Furthermore, for the case where there would be before
an asm goto -> target edge before for the e->dest != target case,
those edges are untouched.
For the immediate effect after the operation, the asm goto keeps
the existing behavior, if it falls through, it will reach target
by hopping through jumpblock, if it jumps to that label, previously
it jumped directly to target, now it jumps to jumpblock and from there
to target.  But shrink-wrapping etc. then put the right fixups everywhere
where it belongs.

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

PR rtl-optimization/116600
PR middle-end/123386
* cfgrtl.cc (force_nonfallthru_and_redirect): Don't do any
asm goto adjustments early, only note in asm_goto_edge if
any labels point originally to e->dest head.  After jumpblock
creation don't add an extra edge for asm_goto_edge, instead
adjust those labels pointing to former e->dest head to point
to jumpblock instead.

* gcc.c-torture/compile/pr116600.c: New test.
* gcc.c-torture/compile/pr123386.c: New test.

4 months agoEnable disabled g++.dg/vect/param-max-aliased-pr26197.cc
Richard Biener [Wed, 11 Feb 2026 09:23:15 +0000 (10:23 +0100)] 
Enable disabled g++.dg/vect/param-max-aliased-pr26197.cc

The glob in g++.dg/vect/vect.exp was not catching the file and
the special option that was intended to be used no longer exists.
I've simplified the situation by renaming the test and fixing it
for the obvious out-of-bound access that is diagnosed.  The test
likely doesn't test anything anymore, but probably better than
simply removing it.

* g++.dg/vect/vect.exp: Remove param-max-aliased-* handling.
* g++.dg/vect/param-max-aliased-pr26197.cc: Rename to ...
* g++.dg/vect/pr26197.cc: ... this and fixup array overflow.

4 months agoc++/reflection: Allow address-splicing of non-static members [PR123660, PR123661]
Boris Staletic [Wed, 11 Feb 2026 07:20:49 +0000 (16:20 +0900)] 
c++/reflection: Allow address-splicing of non-static members [PR123660, PR123661]

In case of expressions like `&[:expr:]` where `expr` depends on a
template parameter, and the splice expression represents a `FIELD_DECL` or
a non-static member `FUNCTION_DECL`, that's exactly what we'd pass on.
However, `build_x_unary_op()` for these expressions is expecting an
`OFFSET_REF`. `OFFSET_REF` is also what gets passed to
`build_x_unary_op()` when templates are not involved.

There's also a difference between the template argument being a type and
using `members_of()` to get to the reflections of members (in which case
evaluating the `SPLICE_EXPR` returns a `FUNCTION_DECL` - `splice10.C`
test) and passing `^^T::member` as the template argument (in which case
evaluating the `SPLICE_EXPR` returns a `BASELINK` - `splice11.C`).

Signed-off-by: Boris Staletic <boris.staletic@protonmail.com>
PR c++/123660
PR c++/123661

gcc/cp/ChangeLog:

* pt.cc (tsubst_splice_expr): Handle pointers to non-static members
from splice expressions

gcc/testsuite/ChangeLog:

* g++.dg/reflect/splice10.C: New test.
* g++.dg/reflect/splice11.C: New test.

4 months agotestsuite: i386: require glibc for C99 libm in vectorize-aocl1.c
Alexandre Oliva [Wed, 11 Feb 2026 00:36:48 +0000 (21:36 -0300)] 
testsuite: i386: require glibc for C99 libm in vectorize-aocl1.c

x86_64-elf fails gcc.target/i386/vectorize-aocl1.c because various
functions aren't recognized as builtins because the target isn't
assumed to offer C99 math library functions, and then the expected
transformations don't occur when calling them.

It would presumably be possible to adjust the test so that it passes
under such conditions, but I'm not undertaking that.  Requiring glibc
isn't quite ideal, but it's probably good enough, even though the test
makes some effort to compile with other libraries.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/vectorize-aocl1.c: Require glibc.

4 months agotestsuite: i386: vect-pr114375 vectorizes only with avx2 runtime
Alexandre Oliva [Wed, 11 Feb 2026 00:36:37 +0000 (21:36 -0300)] 
testsuite: i386: vect-pr114375 vectorizes only with avx2 runtime

This test compiles with -mavx2 only if avx2_runtime passes, and
without that option, it is not expected to vectorize.  Adjust the
effective target requirement for the dump pattern to match that of the
option.

for  gcc/testsuite/ChangeLog

PR tree-optimization/114375
* gcc.dg/vect/vect-pr114375.c: Adjust dump pattern requirement
to match that of options.

4 months agoDaily bump.
GCC Administrator [Wed, 11 Feb 2026 00:16:26 +0000 (00:16 +0000)] 
Daily bump.

4 months agobuild: Correctly restore CXXFLAGS/LDFLAGS for zstd test
Dimitry Andric [Tue, 10 Feb 2026 18:51:58 +0000 (19:51 +0100)] 
build: Correctly restore CXXFLAGS/LDFLAGS for zstd test

Commit r16-5592-g56889bfec25 added saving and restoring of CXXFLAGS and
LDFLAGS in the gcc configure script, to avoid including the wrong zstd
headers.

However, due to misleading indentation in the configure script, the
restoration of CXXFLAGS and LDFLAGS was put after the if block where the
values were saved. This could cause various interesting effects, among
others segfaults while building gcc in the FreeBSD ports system.

Move the restoration of CXXFLAGS and LDFLAGS to just before the end of
the same if block to fix this.

Thanks to Mark Millard for spotting the actual mistake.

2026-02-10  Dimitry Andric  <dimitry@andric.com>

gcc:
PR libfortran/123366
* configure.ac: Move restoring of CXXFLAGS/LDFLAGS for zstd test to
the correct place.
* configure: Regenerate.

Signed-off-by: Dimitry Andric <dimitry@andric.com>
4 months agoa68: lower body of formal hole after context is set
Jose E. Marchesi [Tue, 10 Feb 2026 18:01:18 +0000 (19:01 +0100)] 
a68: lower body of formal hole after context is set

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

* a68-low-units.cc (a68_lower_formal_hole): Call
a68_wrap_formal_proc_hole after a68_add_decl.

4 months agoaarch64: Disable shrink-wrap for locally-streaming functions [PR 123624]
Alice Carlotti [Wed, 14 Jan 2026 13:48:35 +0000 (13:48 +0000)] 
aarch64: Disable shrink-wrap for locally-streaming functions [PR 123624]

The meaning of poly_int values changes depending on whether we are in
streaming or non-streaming mode, but this dependency is not explicitly
tracked.  Locally-streaming functions can change streaming state in the
prologue and epilogue, so it is unsafe to apply shrink wrapping to these
functions, as doing so could change the mode seen by instructions like
cntd.

gcc/ChangeLog:

PR target/123624
* config/aarch64/aarch64-protos.h
(aarch64_use_simple_return_insn_p): New.
* config/aarch64/aarch64.cc
(aarch64_use_simple_return_insn_p): New, used...
* config/aarch64/aarch64.md (simple_return): ...here.

gcc/testsuite/ChangeLog:

PR target/123624
* gcc.target/aarch64/sme/sme-shrinkwrap.c: New test.

4 months agoaarch64: Improve --with-arch checks
Alice Carlotti [Wed, 7 Jan 2026 19:47:45 +0000 (19:47 +0000)] 
aarch64: Improve --with-arch checks

- Check for invalid characters before further processing.  Allow only
  alphanumeric characters, "-", "+" and ".".
- Convert "." to "\." before using user input in a sed expression.
- Reject zero-length extension names.
- Quote variables used in echo commands, to avoid unwanted shell
  expansions.

Without these changes, various invalid inputs would be accepted, for
example due to misparsing of "*" and "." characters in regexps and
shell expansions.  Some inputs could also lead to an infinite loop.

gcc/ChangeLog:

* config.gcc: Improve aarch64 --with-arch checks.

4 months agoc++: fix for saved_token_sentinel
Marek Polacek [Mon, 9 Feb 2026 18:54:39 +0000 (13:54 -0500)] 
c++: fix for saved_token_sentinel

In cp_parser_splice_spec_is_nns_p I didn't use saved_token_sentinel:
its rollback uses cp_lexer_previous_token so if we are the first token
in the file, there are no previous tokens so we crash.

It would be simple to just use the _safe variant of cp_lexer_previous_token
and be done with this.  But that's not how this worked out: I saw a new
-fcompare-debug FAIL with pr104025.C.  The problem is that at the end of
cp_parser_id_expression we have a saved_token_sentinel guarded by
warn_missing_template_keyword and in that spot lexer->buffer is NULL (so
cp_lexer_set_source_position_from_token would be skipped).  pr104025.C
is compiled twice, the second time with "-w -fcompare-debug-second".  So
the first time we don't _set_source_position back to where we were after the
_skip_entire_template_parameter_list (lexer->buffer is NULL) and the second
time we don't get to the saved_token_sentinel at all.  That left us with
different columns in the location:

  "pr104025.C":16:16 vs "pr104025.C":16:12

thus the -fcompare-debug FAIL.  I assume we don't want -fcompare-debug
to ignore the column location.  So we could just save input_location in
saved_token_sentinel instead of trying to recover it.  And then
cp_parser_splice_spec_is_nns_p can be simplified.

gcc/cp/ChangeLog:

* parser.cc (struct saved_token_sentinel): Save input_location.
(saved_token_sentinel::rollback): Restore input_location.
(cp_parser_splice_spec_is_nns_p): Use saved_token_sentinel.  Refactor.

Reviewed-by: Jason Merrill <jason@redhat.com>