]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
2 weeks agoAda: Fix spurious warning for renaming of component of VFA record
Eric Botcazou [Mon, 20 Oct 2025 09:21:21 +0000 (11:21 +0200)] 
Ada: Fix spurious warning for renaming of component of VFA record

This is a regression present on the mainline and all active branches: the
compiler gives a spurious "is not referenced" warning for the renaming of
a component of a Volatile_Full_Access record.

gcc/ada/
PR ada/107536
* exp_ch2.adb (Expand_Renaming): Mark the entity as referenced.

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

2 weeks agoDaily bump.
GCC Administrator [Mon, 20 Oct 2025 00:20:44 +0000 (00:20 +0000)] 
Daily bump.

2 weeks agoDaily bump.
GCC Administrator [Sun, 19 Oct 2025 00:20:06 +0000 (00:20 +0000)] 
Daily bump.

2 weeks agoDaily bump.
GCC Administrator [Sat, 18 Oct 2025 00:21:13 +0000 (00:21 +0000)] 
Daily bump.

3 weeks agoDaily bump.
GCC Administrator [Fri, 17 Oct 2025 00:20:41 +0000 (00:20 +0000)] 
Daily bump.

3 weeks agomatch.pd: Add missing type check to reduc(ctor) pattern [PR121772]
Alex Coplan [Tue, 9 Sep 2025 11:57:14 +0000 (12:57 +0100)] 
match.pd: Add missing type check to reduc(ctor) pattern [PR121772]

This is a cherry-pick of a7a9b7badc0ba95b510c7e61da6439fca78e31d3
together with a follow-up fix to the test
(0c670d38455c788ac0447e3b86ba621521d44bce) squashed into it.

In this PR we have a reduction of a vector constructor, where the
type of the constructor is int16x8_t and the elements are int16x4_t;
i.e. it is representing a concatenation of two vectors.

This triggers a match.pd pattern which looks like it was written to
handle reductions of vector constructors where the elements of the ctor
are scalars, not vectors.  There is no type check to enforce this
property, which leads to the pattern replacing a reduction to scalar
with an int16x4_t vector in this case, which of course is a type error,
leading to an invalid GIMPLE ICE.

This patch adds a type check to the pattern, only going ahead with the
transformation if the element type of the ctor matches that of the
reduction.

gcc/ChangeLog:

PR tree-optimization/121772
* match.pd: Add type check to reduc(ctor) pattern.

gcc/testsuite/ChangeLog:

PR tree-optimization/121772
* gcc.target/aarch64/torture/pr121772.c: New test.

(cherry picked from commit a7a9b7badc0ba95b510c7e61da6439fca78e31d3)

3 weeks agoError out stack-protector unavailability on AIX
Ayappan Perumal [Mon, 1 Sep 2025 13:27:52 +0000 (08:27 -0500)] 
Error out stack-protector unavailability on AIX

stack-protector is not supported in GCC on AIX. This patch is to fail the
compilation if -fstack-protector option is passed.

gcc/ChangeLog:

* config/rs6000/aix.h (SUBTARGET_DRIVER_SELF_SPECS):
Error out when stack-protector option is used in AIX
as it is not supported on AIX

Approved By: Segher Boessenkool <segher@kernel.crashing.org>

(cherry picked from commit dfb7e97dd214f7d8ca0fa970d81ad5ba805aaa8d)

3 weeks agoDaily bump.
GCC Administrator [Thu, 16 Oct 2025 00:23:00 +0000 (00:23 +0000)] 
Daily bump.

3 weeks agoDaily bump.
GCC Administrator [Wed, 15 Oct 2025 00:23:35 +0000 (00:23 +0000)] 
Daily bump.

3 weeks agotree-optimization/120156 - ICE in ptr_derefs_may_alias_p
Richard Biener [Tue, 14 May 2024 09:13:51 +0000 (11:13 +0200)] 
tree-optimization/120156 - ICE in ptr_derefs_may_alias_p

This picks the ptr_derefs_may_alias_p fix from the PR99954 fix
which said:  This makes us run into a latent issue in
ptr_deref_may_alias_decl_p when the pointer is something like &MEM[0].a
in which case we fail to handle non-SSA name pointers.  Add code
similar to what we have in ptr_derefs_may_alias_p.

PR tree-optimization/120156
* tree-ssa-alias.cc (ptr_deref_may_alias_decl_p): Verify
the pointer is an SSA name.

(cherry picked from commit 50d3f67c71cf77a4ec95152079d37adf9d0b0a35)

3 weeks agoDaily bump.
GCC Administrator [Tue, 14 Oct 2025 00:24:00 +0000 (00:24 +0000)] 
Daily bump.

3 weeks agoDaily bump.
GCC Administrator [Mon, 13 Oct 2025 00:21:59 +0000 (00:21 +0000)] 
Daily bump.

3 weeks agoDaily bump.
GCC Administrator [Sun, 12 Oct 2025 00:21:56 +0000 (00:21 +0000)] 
Daily bump.

3 weeks agoDaily bump.
GCC Administrator [Sat, 11 Oct 2025 00:23:40 +0000 (00:23 +0000)] 
Daily bump.

4 weeks agoDaily bump.
GCC Administrator [Fri, 10 Oct 2025 00:24:51 +0000 (00:24 +0000)] 
Daily bump.

4 weeks agoDaily bump.
GCC Administrator [Thu, 9 Oct 2025 00:24:09 +0000 (00:24 +0000)] 
Daily bump.

4 weeks agoDaily bump.
GCC Administrator [Wed, 8 Oct 2025 00:23:32 +0000 (00:23 +0000)] 
Daily bump.

4 weeks agoDaily bump.
GCC Administrator [Tue, 7 Oct 2025 00:24:14 +0000 (00:24 +0000)] 
Daily bump.

4 weeks agoDaily bump.
GCC Administrator [Mon, 6 Oct 2025 00:20:42 +0000 (00:20 +0000)] 
Daily bump.

4 weeks agoFortran: fix TRANSFER with rank 1 unlimited polymorphic SOURCE [PR121263]
Harald Anlauf [Wed, 3 Sep 2025 18:41:20 +0000 (20:41 +0200)] 
Fortran: fix TRANSFER with rank 1 unlimited polymorphic SOURCE [PR121263]

PR fortran/121263

gcc/fortran/ChangeLog:

* trans-intrinsic.cc (gfc_conv_intrinsic_transfer): For an
unlimited polymorphic SOURCE to TRANSFER use saved descriptor
if possible.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 692281a38773a70ae795b3b594f0c0f8fd83e5ef)

4 weeks agoDaily bump.
GCC Administrator [Sun, 5 Oct 2025 16:52:52 +0000 (16:52 +0000)] 
Daily bump.

5 weeks ago[committed] [PR rtl-optimization/101188] Fix reload_cse_move2add ignoring clobbers
Jeff Law [Mon, 12 Jun 2023 18:52:10 +0000 (12:52 -0600)] 
[committed] [PR rtl-optimization/101188] Fix reload_cse_move2add ignoring clobbers

So as Georg-Johann discusses in the BZ, reload_cse_move2add can generate
 incorrect code when optimizing code with clobbers.  Specifically in the
case where we try to optimize a sequence of 4 operations down to 3
operations we can reset INSN to the next instruction and continue the loop.

That skips the code to invalidate objects based on things like REG_INC
nodes, stack pushes and most importantly clobbers attached to the current
insn.

This patch factors all of the invalidation code used by reload_cse_move2add
into a new function and calls it at the appropriate time.

Georg-Johann has confirmed this patch fixes his avr bug and I've had it in
my tester over the weekend.  It's bootstrapped and regression tested on
aarch64, m68k, sh4, alpha and hppa.  It's also regression tested successfully
on a wide variety of other targets.

gcc/
PR rtl-optimization/101188
* postreload.cc (reload_cse_move2add_invalidate): New function,
extracted from...
(reload_cse_move2add): Call reload_cse_move2add_invalidate.

gcc/testsuite
PR rtl-optimization/101188
* gcc.c-torture/execute/pr101188.c: New test

(cherry picked from commit ae193f9008e02683e27f3c87f3b06f38e103b1d0)

5 weeks agoDaily bump.
GCC Administrator [Thu, 2 Oct 2025 00:23:04 +0000 (00:23 +0000)] 
Daily bump.

5 weeks agoDaily bump.
GCC Administrator [Wed, 1 Oct 2025 00:24:12 +0000 (00:24 +0000)] 
Daily bump.

5 weeks agoDaily bump.
GCC Administrator [Tue, 30 Sep 2025 00:23:48 +0000 (00:23 +0000)] 
Daily bump.

5 weeks agoDaily bump.
GCC Administrator [Mon, 29 Sep 2025 00:21:22 +0000 (00:21 +0000)] 
Daily bump.

5 weeks agoDaily bump.
GCC Administrator [Sun, 28 Sep 2025 00:21:52 +0000 (00:21 +0000)] 
Daily bump.

5 weeks agoDaily bump.
GCC Administrator [Sat, 27 Sep 2025 00:21:26 +0000 (00:21 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Fri, 26 Sep 2025 00:21:41 +0000 (00:21 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Thu, 25 Sep 2025 00:22:40 +0000 (00:22 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Wed, 24 Sep 2025 00:23:11 +0000 (00:23 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Tue, 23 Sep 2025 00:23:01 +0000 (00:23 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Mon, 22 Sep 2025 00:21:31 +0000 (00:21 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Sun, 21 Sep 2025 00:21:25 +0000 (00:21 +0000)] 
Daily bump.

6 weeks agoDaily bump.
GCC Administrator [Sat, 20 Sep 2025 00:21:59 +0000 (00:21 +0000)] 
Daily bump.

7 weeks agoDaily bump.
GCC Administrator [Fri, 19 Sep 2025 00:21:51 +0000 (00:21 +0000)] 
Daily bump.

7 weeks agoRemove SPR/GNR/DMR from avx512_{move,store}_by pieces tune.
hongtao.liu [Tue, 16 Sep 2025 01:23:45 +0000 (03:23 +0200)] 
Remove SPR/GNR/DMR from avx512_{move,store}_by pieces tune.

Align move_max with prefer_vector_width for SPR/GNR/DMR similar as
below commit.

commit 6ea25c041964bf63014fcf7bb68fb1f5a0a4e123
Author: liuhongt <hongtao.liu@intel.com>
Date:   Thu Aug 15 12:54:07 2024 +0800

    Align ix86_{move_max,store_max} with vectorizer.

    When none of mprefer-vector-width, avx256_optimal/avx128_optimal,
    avx256_store_by_pieces/avx512_store_by_pieces is specified, GCC will
    set ix86_{move_max,store_max} as max available vector length except
    for AVX part.

                  if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
                      && TARGET_EVEX512_P (opts->x_ix86_isa_flags2))
                    opts->x_ix86_move_max = PVW_AVX512;
                  else
                    opts->x_ix86_move_max = PVW_AVX128;

    So for -mavx2, vectorizer will choose 256-bit for vectorization, but
    128-bit is used for struct copy, there could be a potential STLF issue
    due to this "misalign".

gcc/ChangeLog:

* config/i386/x86-tune.def (X86_TUNE_AVX512_MOVE_BY_PIECES):
Remove SPR/GNR/DMR.
(X86_TUNE_AVX512_STORE_BY_PIECES): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pieces-memcpy-18.c: Use -mtune=znver5
instead of -mtune=sapphirerapids.
* gcc.target/i386/pieces-memcpy-21.c: Ditto.
* gcc.target/i386/pieces-memset-46.c: Ditto.
* gcc.target/i386/pieces-memset-49.c: Ditto.

(cherry picked from commit dd713d0f3fc88778a9b3d4f8f1895a3cd6c145ca)

7 weeks agoDaily bump.
GCC Administrator [Thu, 18 Sep 2025 00:22:19 +0000 (00:22 +0000)] 
Daily bump.

7 weeks agotree-sra: Avoid total SRA if there are incompat. aggregate accesses (PR119085)
Martin Jambor [Wed, 23 Jul 2025 09:22:33 +0000 (11:22 +0200)] 
tree-sra: Avoid total SRA if there are incompat. aggregate accesses  (PR119085)

We currently use the types encountered in the function body and not in
type declaration to perform total scalarization.  Bug PR 119085
uncovered that we miss a check that when the same data is accessed
with aggregate types that those are actually compatible.  Without it,
we can base total scalarization on a type that does not "cover" all
live data in a different part of the function.  This patch adds the
check.

gcc/ChangeLog:

2025-07-21  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/119085
* tree-sra.cc (sort_and_splice_var_accesses): Prevent total
scalarization if two incompatible aggregates access the same place.

gcc/testsuite/ChangeLog:

2025-07-21  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/119085
* gcc.dg/tree-ssa/pr119085.c: New test.

(cherry picked from commit dabac057141c26a69325a410c81de0ff2157c6c9)

7 weeks agotree-sra: Fix grp_covered flag computation when totally scalarizing (PR117423)
Martin Jambor [Thu, 17 Jul 2025 16:28:33 +0000 (18:28 +0200)] 
tree-sra: Fix grp_covered flag computation when totally scalarizing (PR117423)

Testcase of PR 117423 shows a flaw in the fancy way we do "total
scalarization" in SRA now.  We use the types encountered in the
function body and not in type declaration (allowing us to totally
scalarize when only one union field is ever used, since we effectively
"skip" the union then) and can accommodate pre-existing accesses that
happen to fall into padding.

In this case, we skipped the union (bypassing the
totally_scalarizable_type_p check) and the access falling into the
"padding" is an aggregate and so not a candidate for SRA but actually
containing data.  Arguably total scalarization should just bail out
when it encounters this situation (but I decided not to depend on this
mainly because we'd need to detect all cases when we eventually cannot
scalarize, such as when a scalar access has children accesses) but the
actual bug is that the detection if all data in an aggregate is indeed
covered by replacements just assumes that is always the case if total
scalarization triggers which however may not be the case in cases like
this - and perhaps more.

This patch fixes the bug by just assuming that all padding is taken
care of when total scalarization triggered, not that every access was
actually scalarized.

gcc/ChangeLog:

2025-07-17  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/117423
* tree-sra.cc (analyze_access_subtree): Fix computation of grp_covered
flag.

gcc/testsuite/ChangeLog:

2025-07-17  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/117423
* gcc.dg/tree-ssa/pr117423.c: New test.

(cherry picked from commit 7efca50a9a18e69a4921140fc5a0325e3f519b1a)

7 weeks agoDaily bump.
GCC Administrator [Wed, 17 Sep 2025 00:22:10 +0000 (00:22 +0000)] 
Daily bump.

7 weeks agoFix latent LRA bug
Jeff Law [Fri, 12 Sep 2025 22:08:38 +0000 (16:08 -0600)] 
Fix latent LRA bug

Shreya's work to add the addptr pattern on the RISC-V port exposed a latent bug
in LRA.

We lazily allocate/reallocate the ira_reg_equiv structure and when we do
(re)allocation we'll over-allocate and zero-fill so that we don't have to
actually allocate and relocate the data so often.

In the case exposed by Shreya's work we had N requested entries at the last
rellocation step.  We actually allocate N+M entries.  During LRA we allocate
enough new pseudos and thus have N+M+1 pseudos.

In get_equiv we read ira_reg_equiv[regno] without bounds checking so we read
past the allocated part of the array and get back junk which we use and
depending on the precise contents we fault in various fun and interesting ways.

We could either arrange to re-allocate ira_reg_equiv again on some path through
LRA (possibly in get_equiv itself).  We could also just insert the bounds check
in get_equiv like is done elsewhere in LRA.  Vlad indicated no strong
preference in an email last week.

So this just adds the bounds check in a manner similar to what's done elsewhere
in LRA.  Bootstrapped and regression tested on x86_64 as well as RISC-V with
Shreya's work enabled and regtested across the various embedded targets.

gcc/
* lra-constraints.cc (get_equiv): Bounds check before accessing
data in ira_reg_equiv.

(cherry picked from commit 0c6ad3f5dfbd45150eeef2474899ba7ef0d8e592)

7 weeks agoDaily bump.
GCC Administrator [Tue, 16 Sep 2025 00:22:12 +0000 (00:22 +0000)] 
Daily bump.

7 weeks agoAVR: Support more AVR-DA-S and AVR-EB devices.
Georg-Johann Lay [Mon, 15 Sep 2025 14:09:06 +0000 (16:09 +0200)] 
AVR: Support more AVR-DA-S and AVR-EB devices.

gcc/
* config/avr/avr-mcus.def: Support AVR32DA28S, AVR32DA32S,
AVR32DA48S, AVR64DA28S, AVR64DA32S, AVR64DA48S AVR64DA64S,
AVR128DA28S, AVR128DA32S, AVR128DA48S, AVR128DA64S,
AVR32EB14, AVR32EB20, AVR32EB28, AVR32EB32.
* doc/avr-mmcu.texi: Rebuild.

7 weeks agoc++: Fix mangling of _Float16 template args [PR121801]
Matthias Kretz [Fri, 5 Sep 2025 10:16:34 +0000 (12:16 +0200)] 
c++: Fix mangling of _Float16 template args [PR121801]

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
gcc/testsuite/ChangeLog:

PR c++/121801
* g++.dg/abi/pr121801.C: New test.

gcc/cp/ChangeLog:

PR c++/121801
* mangle.cc (write_real_cst): Handle 16-bit real and assert
that reals have 16 bits or a multiple of 32 bits.

(cherry picked from commit 19d1c7c28f4fd0557dd868a7a4041b00ceada890)

7 weeks agoDaily bump.
GCC Administrator [Mon, 15 Sep 2025 00:19:22 +0000 (00:19 +0000)] 
Daily bump.

7 weeks agoDaily bump.
GCC Administrator [Sun, 14 Sep 2025 00:20:56 +0000 (00:20 +0000)] 
Daily bump.

7 weeks agoDaily bump.
GCC Administrator [Sat, 13 Sep 2025 00:20:21 +0000 (00:20 +0000)] 
Daily bump.

8 weeks agoDaily bump.
GCC Administrator [Fri, 12 Sep 2025 00:22:10 +0000 (00:22 +0000)] 
Daily bump.

8 weeks agoDaily bump.
GCC Administrator [Thu, 11 Sep 2025 00:21:42 +0000 (00:21 +0000)] 
Daily bump.

8 weeks agoAVR: Disable tree-switch-conversion per default.
Georg-Johann Lay [Sat, 6 Sep 2025 11:38:48 +0000 (13:38 +0200)] 
AVR: Disable tree-switch-conversion per default.

There are at least two cases where tree-switch-conversion leads
to unpleasant resource allocation:

PR49857
    The lookup table lives in RAM.  This is the case for all
    devices that locate .rodata in RAM, which is for almost
    all AVR devices.

PR81540
    Code is bloated for 64-bit inputs.

As far as PR49857 is concerned, a target hook that may add an
address-space qualifier to the lookup table is the obvious
solution, though a respective patch has always been rejected by
global maintainers for non-technical reasons.

gcc/
PR target/81540
PR target/49857
* common/config/avr/avr-common.cc: Disable -ftree-switch-conversion.

(cherry picked from commit 912159d2b5429c3126756b56723dd4f32dd56bdd)

8 weeks agoDaily bump.
GCC Administrator [Wed, 10 Sep 2025 00:26:21 +0000 (00:26 +0000)] 
Daily bump.

8 weeks agolibstdc++: Document remaining C++17 implementation-defined behavior.
Tomasz Kamiński [Fri, 5 Sep 2025 14:08:12 +0000 (16:08 +0200)] 
libstdc++: Document remaining C++17 implementation-defined behavior.

This also covers bad_function_call::what from C++11.

libstdc++-v3/ChangeLog:

* doc/html/manual/status.html: Regenerate.
* doc/xml/manual/status_cxx2011.xml: Add entry for bad_function_call.
* doc/xml/manual/status_cxx2017.xml: Add entries for bad_any_cast
and nullptr_t output. Update entry for sf.cmath. Fix stable name for
mem.res.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit 39d7c4d42a764a86644198a517f58a94f467cdbd)

8 weeks agolibstdc++: Document missing implementation defined behavior for std::filesystem.
Tomasz Kamiński [Fri, 5 Sep 2025 11:16:40 +0000 (13:16 +0200)] 
libstdc++: Document missing implementation defined behavior for std::filesystem.

libstdc++-v3/ChangeLog:

* doc/html/manual/status.html: Regenerate the file.
* doc/xml/manual/status_cxx2017.xml: Addd more entires.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit d6c370b8e96d43448537276d91c2b33fedb9754a)

8 weeks agoDaily bump.
GCC Administrator [Tue, 9 Sep 2025 00:26:33 +0000 (00:26 +0000)] 
Daily bump.

8 weeks agolibstdc++: Fix docs for --enable-vtable-verify [PR120698]
Jonathan Wakely [Wed, 18 Jun 2025 14:46:24 +0000 (15:46 +0100)] 
libstdc++: Fix docs for --enable-vtable-verify [PR120698]

libstdc++-v3/ChangeLog:

PR libstdc++/120698
* doc/xml/manual/configure.xml: Do not claim that vtv is enabled
by default.
* doc/html/manual/configure.html: Regenerate.

(cherry picked from commit d199a9c7c5034d0eddb3380a58342a5bcbe6febd)

2 months agoDaily bump.
GCC Administrator [Mon, 8 Sep 2025 00:23:30 +0000 (00:23 +0000)] 
Daily bump.

2 months agolibphobos: enable for more hppa tuples
Sam James [Mon, 24 Mar 2025 04:34:06 +0000 (04:34 +0000)] 
libphobos: enable for more hppa tuples

Gentoo uses hppa1.1*-*-linux* and hppa2.0*-*-linux* instead of Debian's
hppa-*-linux*.

libphobos/ChangeLog:

* configure.tgt: Add hppa[12]*-*-linux* as a supported target.

(cherry picked from commit 35cf8d85841a6301eeb12668085e326ddd115f6e)

2 months agolibphobos: enable for sparc64-unknown-linux-gnu
Sam James [Sun, 20 Apr 2025 00:43:39 +0000 (01:43 +0100)] 
libphobos: enable for sparc64-unknown-linux-gnu

This bootstraps with some test failures but works well enough to build
11..15.

libphobos/ChangeLog:

* configure.tgt: Add sparc64-unknown-linux-gnu as a supported target.

(cherry picked from commit 2572d46f0d1e426c1091f9b84861ee5213b84b5a)

2 months agolibphobos: enable for powerpc64le-linux-gnu
Matthias Klose [Sun, 7 Sep 2025 08:55:47 +0000 (10:55 +0200)] 
libphobos: enable for powerpc64le-linux-gnu

libphobos/ChangeLog:

* configure.tgt: Add powerpc64le--linux-gnu as a supported target
when configured with --with-long-double-format=ieee.

2 months agoDaily bump.
GCC Administrator [Sun, 7 Sep 2025 00:22:23 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sat, 6 Sep 2025 00:23:28 +0000 (00:23 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Fri, 5 Sep 2025 00:21:37 +0000 (00:21 +0000)] 
Daily bump.

2 months agolibstdc++: Make CTAD ignore pair(const T1&, const T2&) constructor [PR110853]
Jonathan Wakely [Tue, 2 Sep 2025 21:30:46 +0000 (22:30 +0100)] 
libstdc++: Make CTAD ignore pair(const T1&, const T2&) constructor [PR110853]

For the pair(T1, T2) explicit deduction type to decay its arguments as
intended, we need the pair(const T1&, const T2&) constructor to not be
used for CTAD. Otherwise we try to instantiate pair<T1, T2> without
decaying, which is ill-formed for function lvalues.

Use std::type_identity_t<T1> to make the constructor unusable for an
implicit deduction guide.

libstdc++-v3/ChangeLog:

PR libstdc++/110853
* include/bits/stl_pair.h [C++20] (pair(const T1&, const T2&)):
Use std::type_identity_t<T1> for first parameter.
* testsuite/20_util/pair/cons/110853.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit 0bb0d1d2880d562298eeec8eee4ab4e8ba943260)

2 months agolibstdc++: Fix std::get<T> for std::pair with reference members [PR121745]
Jonathan Wakely [Mon, 1 Sep 2025 17:12:27 +0000 (18:12 +0100)] 
libstdc++: Fix std::get<T> for std::pair with reference members [PR121745]

Make the std::get<T> overloads for rvalues use std::forward<T>(p.first)
not std::move(p.first), so that lvalue reference members are not
incorrectly converted to rvalues.

It might appear that std::move(p).first would also work, but the
language rules say that for std::pair<T&&, U> that would produce T&
rather than the expected T&& (see the discussion in P2445R1 §8.2).

Additional tests are added to verify all combinations of reference
members, value categories, and const-qualification.

libstdc++-v3/ChangeLog:

PR libstdc++/121745
* include/bits/stl_pair.h (get): Use forward instead of move in
std::get<T> overloads for rvalue pairs.
* testsuite/20_util/pair/astuple/get_by_type.cc: Check all value
categories and cv-qualification.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit c8a24f60b6874fca4fb3adb153f8d5f1dd72b951)

2 months agolibstdc++: Use __promote_3 for std::hypot [PR121097]
Jonathan Wakely [Tue, 15 Jul 2025 20:29:33 +0000 (21:29 +0100)] 
libstdc++: Use __promote_3 for std::hypot [PR121097]

The __promoted_t alias is only defined when __cpp_fold_expressions is
defined, which might not be the case for some hypothetical C++17
compilers.

Change the 3-arg std::hypot to just use __gnu_cxx::__promote_3 which is
always available.

libstdc++-v3/ChangeLog:

PR libstdc++/121097
* include/c_global/cmath (hypot): Use __promote_3 instead of
__promoted.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit f4932c59df387a505de69a5a1015a03caa4ccf08)

2 months agoDaily bump.
GCC Administrator [Thu, 4 Sep 2025 00:22:54 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Wed, 3 Sep 2025 00:22:42 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Tue, 2 Sep 2025 00:22:53 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Mon, 1 Sep 2025 00:22:26 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sun, 31 Aug 2025 00:24:52 +0000 (00:24 +0000)] 
Daily bump.

2 months agoRevert "Fix _Decimal128 arithmetic error under FE_UPWARD."
liuhongt [Sat, 30 Aug 2025 02:24:20 +0000 (19:24 -0700)] 
Revert "Fix _Decimal128 arithmetic error under FE_UPWARD."

This reverts commit 44287e850b94de27c3a398fd75936a962c12b1b8.

2 months agoDaily bump.
GCC Administrator [Sat, 30 Aug 2025 00:22:35 +0000 (00:22 +0000)] 
Daily bump.

2 months agoFix _Decimal128 arithmetic error under FE_UPWARD.
liuhongt [Thu, 28 Aug 2025 01:20:09 +0000 (18:20 -0700)] 
Fix _Decimal128 arithmetic error under FE_UPWARD.

libgcc/config/libbid/ChangeLog:

PR target/120691
* bid128_div.c: Fix _Decimal128 arithmetic error under
FE_UPWARD.
* bid128_rem.c: Ditto.
* bid128_sqrt.c: Ditto.
* bid64_div.c (bid64_div): Ditto.
* bid64_sqrt.c (bid64_sqrt): Ditto.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 50064b2898edfb83bc37f2597a35cbd3c1c853e3)

2 months agoDaily bump.
GCC Administrator [Fri, 29 Aug 2025 00:23:39 +0000 (00:23 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Thu, 28 Aug 2025 00:23:50 +0000 (00:23 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Wed, 27 Aug 2025 00:23:02 +0000 (00:23 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Tue, 26 Aug 2025 00:24:01 +0000 (00:24 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Mon, 25 Aug 2025 00:22:10 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sun, 24 Aug 2025 00:22:59 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sat, 23 Aug 2025 00:22:59 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Fri, 22 Aug 2025 00:23:23 +0000 (00:23 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Thu, 21 Aug 2025 00:23:55 +0000 (00:23 +0000)] 
Daily bump.

2 months agoAVR: target/121608 - Don't add --relax when linking with -r.
Georg-Johann Lay [Wed, 20 Aug 2025 08:53:37 +0000 (10:53 +0200)] 
AVR: target/121608 - Don't add --relax when linking with -r.

The linker rejects --relax in relocatable links (-r), hence only
add --relax when -r is not specified.

gcc/
PR target/121608
* config/avr/specs.h (LINK_RELAX_SPEC): Wrap in %{!r...}.

(cherry picked from commit 0f15ff7b511493e9197e6153b794081c1557ba02)

2 months agoDaily bump.
GCC Administrator [Wed, 20 Aug 2025 00:22:34 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Tue, 19 Aug 2025 00:23:23 +0000 (00:23 +0000)] 
Daily bump.

2 months agoaarch64: Fix mode mismatch when building a predicate [PR121118]
Richard Sandiford [Mon, 18 Aug 2025 15:11:21 +0000 (16:11 +0100)] 
aarch64: Fix mode mismatch when building a predicate [PR121118]

This PR is about a case where we used aarch64_expand_sve_const_pred_trn
to combine two predicates, one of which was constructing using
aarch64_sve_move_pred_via_while.  The former requires the inputs
to have mode VNx16BI, but the latter returned VNx8BI for a .H
WHILELO.

The proper fix, used on trunk, is to make the pattern emitted by
aarch64_sve_move_pred_via_while produce an VNx16BI for all element
sizes, since every bit of the result is significant.  However,
that required some target-independent changes that are too invasive
to backport.  This patch goes for the simpler (but less robust) approach
of using the original pattern and casting it to VNx16BI after the fact.

Since the WHILELO pattern is an unspec, the chances of something
optimising it in a way that changes the undefined bits of the output
should be very low, especially on a release branch.  It is still a less
satisfactory fix though.

gcc/
PR target/121118
* config/aarch64/aarch64.cc (aarch64_sve_move_pred_via_while):
Return a VNx16BI predicate.

gcc/testsuite/
PR target/121118
* gcc.target/aarch64/sve/acle/general/pr121118_1.c: New test.

(cherry picked from commit 58a9717df098defb7f595fbc56122107e952a46b)

2 months agofwprop: Don't propagate asms [PR121253]
Richard Sandiford [Mon, 18 Aug 2025 15:11:19 +0000 (16:11 +0100)] 
fwprop: Don't propagate asms [PR121253]

For the reasons explained in the comment, fwprop shouldn't even
try to propagate an asm definition.

gcc/
PR rtl-optimization/121253
* fwprop.cc (forward_propagate_into): Don't propagate asm defs.

gcc/testsuite/
PR rtl-optimization/121253
* gcc.target/aarch64/pr121253.c: New test.

(cherry picked from commit e82c8413eda498163ae2e0ecc458ea0428708c30)

2 months agoDaily bump.
GCC Administrator [Mon, 18 Aug 2025 00:21:57 +0000 (00:21 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sun, 17 Aug 2025 00:22:53 +0000 (00:22 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Sat, 16 Aug 2025 00:23:10 +0000 (00:23 +0000)] 
Daily bump.

2 months agoAArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]
Pengfei Li [Thu, 14 Aug 2025 13:59:48 +0000 (13:59 +0000)] 
AArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]

This patch fixes incorrect constraints in RTL patterns for AArch64 SVE
gather/scatter with type widening/narrowing and vector-plus-immediate
addressing. The bug leads to below "immediate offset out of range"
errors during assembly, eventually causing compilation failures.

/tmp/ccsVqBp1.s: Assembler messages:
/tmp/ccsVqBp1.s:54: Error: immediate offset out of range 0 to 31 at operand 3 -- `ld1b z1.d,p0/z,[z1.d,#64]'

Current RTL patterns for such instructions incorrectly use vgw or vgd
constraints for the immediate operand, base on the vector element type
in Z registers (zN.s or zN.d). However, for gather/scatter with type
conversions, the immediate range for vector-plus-immediate addressing is
determined by the element type in memory, which differs from that in
vector registers. Using the wrong constraint can produce out-of-range
offset values that cannot be encoded in the instruction.

This patch corrects the constraints used in these patterns. A test case
that reproduces the issue is also included.

Bootstrapped and regression-tested on aarch64-linux-gnu.

gcc/ChangeLog:
PR target/121449
* config/aarch64/aarch64-sve.md
(mask_gather_load<mode><v_int_container>): Use vg<Vesize>
constraints for alternatives with immediate offset.
(mask_scatter_store<mode><v_int_container>): Likewise.

gcc/testsuite/ChangeLog:
PR target/121449
* g++.target/aarch64/sve/pr121449.C: New test.

2 months agoDaily bump.
GCC Administrator [Fri, 15 Aug 2025 00:22:19 +0000 (00:22 +0000)] 
Daily bump.

2 months agoaarch64: Use VNx16BI for svrev_b* [PR121294]
Richard Sandiford [Thu, 14 Aug 2025 20:55:28 +0000 (21:55 +0100)] 
aarch64: Use VNx16BI for svrev_b* [PR121294]

The previous patch for PR121294 handled svtrn1/2, svuzp1/2, and svzip1/2.
This one extends it to handle svrev intrinsics, where the same kind of
wrong code can be generated.

gcc/
PR target/121294
* config/aarch64/aarch64.md (UNSPEC_REV_PRED): New unspec.
* config/aarch64/aarch64-sve.md (@aarch64_sve_rev<mode>_acle)
(*aarch64_sve_rev<mode>_acle): New patterns.
* config/aarch64/aarch64-sve-builtins-base.cc
(svrev_impl::expand): Use the new patterns for boolean svrev.

gcc/testsuite/
PR target/121294
* gcc.target/aarch64/sve/acle/general/rev_2.c: New test.

(cherry picked from commit 701193a7a6d3f3f345bf336e7ebc7d6fa1e0c5ac)

2 months agoaarch64: Use VNx16BI for more permutations [PR121294]
Richard Sandiford [Thu, 14 Aug 2025 20:55:28 +0000 (21:55 +0100)] 
aarch64: Use VNx16BI for more permutations [PR121294]

The patterns for the predicate forms of svtrn1/2, svuzp1/2,
and svzip1/2 are shared with aarch64_vectorize_vec_perm_const.
The .H, .S, and .D forms operate on VNx8BI, VNx4BI, and VNx2BI
respectively.  Thus, for all four element widths, there is one
significant bit per element, for both the inputs and the output.

That's appropriate for aarch64_vectorize_vec_perm_const but not
for the ACLE intrinsics, where every bit of the output is
significant, and where every bit of the selected input elements
is therefore also significant.  The current expansion can lead
the optimisers to simplify inputs by changing the upper bits
of the input elements (since the current patterns claim that
those bits don't matter), which in turn leads to wrong code.

The ACLE expansion should operate on VNx16BI instead, for all
element widths.

There was already a pattern for a VNx16BI-only form of TRN1, for
constructing certain predicate constants.  The patch generalises it to
handle the other five permutations as well.  For the reasons given in
the comments, this is done by making the permutation unspec an operand
to a new UNSPEC_PERMUTE_PRED, rather than overloading the existing
unspecs, and rather than adding a new unspec for each permutation.

gcc/
PR target/121294
* config/aarch64/iterators.md (UNSPEC_TRN1_CONV): Delete.
(UNSPEC_PERMUTE_PRED): New unspec.
* config/aarch64/aarch64-sve.md (@aarch64_sve_trn1_conv<mode>):
Replace with...
(@aarch64_sve_<perm_insn><mode>_acle)
(*aarch64_sve_<perm_insn><mode>_acle): ...these new patterns.
* config/aarch64/aarch64.cc (aarch64_expand_sve_const_pred_trn):
Update accordingly.
* config/aarch64/aarch64-sve-builtins-functions.h
(binary_permute::expand): Use the new _acle patterns for
predicate operations.

gcc/testsuite/
PR target/121294
* gcc.target/aarch64/sve/acle/general/perm_2.c: New test.
* gcc.target/aarch64/sve/acle/general/perm_3.c: Likewise.
* gcc.target/aarch64/sve/acle/general/perm_4.c: Likewise.
* gcc.target/aarch64/sve/acle/general/perm_5.c: Likewise.
* gcc.target/aarch64/sve/acle/general/perm_6.c: Likewise.
* gcc.target/aarch64/sve/acle/general/perm_7.c: Likewise.

(cherry picked from commit 4cf9d4ebdd68a724eb41044cd8f2a4d466d81c7f)

2 months agox86: Pass -mno-80387 to compile pr121208-1(a|b).c
H.J. Lu [Tue, 29 Jul 2025 16:11:34 +0000 (09:11 -0700)] 
x86: Pass -mno-80387 to compile pr121208-1(a|b).c

Pass -mno-80387 to compile pr121208-1(a|b).c to silence

.../pr121208-1a.c:11:1: sorry, unimplemented: 80387 instructions aren’t allowed in a function with the ‘no_caller_saved_registers’ attribute

Partially backport the PR target/121540 fix

9d7f45e9806 x86: Disallow MMX and 80387 in no_caller_saved_registers function

to also add -mno-sse -mno-mmx.

PR target/121208
* gcc.target/i386/pr121208-1a.c (dg-options): Add
-mno-sse -mno-mmx -mno-80387.
* gcc.target/i386/pr121208-1b.c (dg-options): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit c6d1f58da7eb72e8bac307d342e4655012b36a89)

2 months agox86: Disallow -mtls-dialect=gnu with no_caller_saved_registers
H.J. Lu [Thu, 24 Jul 2025 14:38:13 +0000 (07:38 -0700)] 
x86: Disallow -mtls-dialect=gnu with no_caller_saved_registers

__tls_get_addr doesn't preserve vector registers.  When a function
with no_caller_saved_registers attribute calls __tls_get_addr, YMM
and ZMM registers will be clobbered.  Issue an error and suggest
-mtls-dialect=gnu2 in this case.

gcc/

PR target/121208
* config/i386/i386.cc (ix86_tls_get_addr): Issue an error for
-mtls-dialect=gnu with no_caller_saved_registers attribute and
suggest -mtls-dialect=gnu2.

gcc/testsuite/

PR target/121208
* gcc.target/i386/pr121208-1a.c: New test.
* gcc.target/i386/pr121208-1b.c: Likewise.
* gcc.target/i386/pr121208-2a.c: Likewise.
* gcc.target/i386/pr121208-2b.c: Likewise.
* gcc.target/i386/pr121208-3a.c: Likewise.
* gcc.target/i386/pr121208-3b.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 5760ddbce26ff9c5c8851b6b2089ad65981d5078)

2 months agoDaily bump.
GCC Administrator [Thu, 14 Aug 2025 00:21:50 +0000 (00:21 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Wed, 13 Aug 2025 00:21:16 +0000 (00:21 +0000)] 
Daily bump.

2 months agoDaily bump.
GCC Administrator [Tue, 12 Aug 2025 00:21:08 +0000 (00:21 +0000)] 
Daily bump.