]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
4 hours agoarm: [MVE] Fix operands order in vbicq_f [PR122223] releases/gcc-14
Christophe Lyon [Thu, 9 Oct 2025 14:09:26 +0000 (14:09 +0000)] 
arm: [MVE] Fix operands order in vbicq_f [PR122223]

The operands of the floating-point version of vbicq were swapped, this
patch fixes this.

For this backport the testcase needs an adjustment: the code is less
optimized than with gcc-15, so we still generate the 0.0f constant and
a vbic instruction.  We actually check that the 0.0f constant is in
the right vbic parameter.

gcc/ChangeLog:
PR target/122223
* config/arm/mve.md (@mve_vbicq_f<mode>): Fix operands order.

gcc/testsuite/ChangeLog:
PR target/122223
* gcc.target/arm/mve/intrinsics/pr122223.c: New test.

(cherry picked from commits
81e226440381cc3e033df7e58cc7793c9b4b4e25 and
a52888dc71924afb6cd187b0e5f18d2be4c68a07)

14 hours agoDaily bump.
GCC Administrator [Fri, 7 Nov 2025 00:26:11 +0000 (00:26 +0000)] 
Daily bump.

18 hours agoAVR: target/122516: Make attribute "retain" work.
Georg-Johann Lay [Thu, 6 Nov 2025 19:20:49 +0000 (20:20 +0100)] 
AVR: target/122516: Make attribute "retain" work.

Due to some quirks in crtstuff.c, attribute "retain" requires
some features that avr doesn't implement -- even though it
doesnt't even use crtstuff.  This patch works around that.

PR target/122516
gcc/
* config/avr/elf.h (SUPPORTS_SHF_GNU_RETAIN): Define if
HAVE_GAS_SHF_GNU_RETAIN.

(cherry picked from commit d5ede6fff1ff19738d60350856ab852522809068)

18 hours agoAVR: AVR-SD: Put a valid opcode prior to gs() table in .subsection 1.
Georg-Johann Lay [Thu, 6 Nov 2025 18:59:48 +0000 (19:59 +0100)] 
AVR: AVR-SD: Put a valid opcode prior to gs() table in .subsection 1.

On functional safety devices (AVR-SD), each executed instruction must
be followed by a valid opcode.  This is because instruction fetch and
decode for the next instruction runs while the 2-stage pipeline is
executing the current instruction.

There is only one case where avr-gcc generates code interspersed with
data, which is when a switch/case table is generated for a function
with a "section" attribute and AVR_HAVE_JMP_CALL.  In that case, the
table with the gs() code label addresses is put in .subsection 1 so
that it belongs to the section as specified by the "section" attribute.

gcc/
* config/avr/avr.cc (avr_output_addr_vec): Output
a valid opcode prior to the first gs() label provided:
- The code is compiled for an arch that has AVR-SD mcus, and
- the function has a "section" attribute, and
- the function has a gs() label addresses switch/case table.

(cherry picked from commit d79d12d3faea6c4472ede35e4b66a68cf1f85f77)

38 hours agoDaily bump.
GCC Administrator [Thu, 6 Nov 2025 00:28:46 +0000 (00:28 +0000)] 
Daily bump.

2 days agoDaily bump.
GCC Administrator [Wed, 5 Nov 2025 00:25:32 +0000 (00:25 +0000)] 
Daily bump.

3 days agoDaily bump.
GCC Administrator [Tue, 4 Nov 2025 00:25:31 +0000 (00:25 +0000)] 
Daily bump.

3 days agoAVR: target/122527 -- Don't use __load_N to load from __flash1.
Georg-Johann Lay [Sun, 2 Nov 2025 14:12:59 +0000 (15:12 +0100)] 
AVR: target/122527 -- Don't use __load_N to load from __flash1.

This patch fixes a case where a 3 byte or 4 byte load from __flash1
uses __load_3/4 to read the value, which is wrong.

This only occured when the device has ELPM but not ELPMx (avr31).

PR target/122527
gcc/
* config/avr/avr.cc (avr_load_libgcc_p): Return false if
the address-space is not ADDR_SPACE_FLASH.
(avr_out_lpm_no_lpmx [addr=REG]): Handle sizes of 3 and 4 bytes.

(cherry picked from commit 0b2c031cca4017c5f87af519f0977b33b4bcb284)

4 days agoDaily bump.
GCC Administrator [Mon, 3 Nov 2025 00:25:18 +0000 (00:25 +0000)] 
Daily bump.

5 days agoDaily bump.
GCC Administrator [Sun, 2 Nov 2025 00:26:02 +0000 (00:26 +0000)] 
Daily bump.

6 days agoDaily bump.
GCC Administrator [Sat, 1 Nov 2025 00:23:59 +0000 (00:23 +0000)] 
Daily bump.

7 days agoDaily bump.
GCC Administrator [Fri, 31 Oct 2025 00:26:54 +0000 (00:26 +0000)] 
Daily bump.

8 days agoLoongArch: Standard instruction template fnmam4 correction
Guo Jie [Wed, 29 Oct 2025 08:38:54 +0000 (16:38 +0800)] 
LoongArch: Standard instruction template fnmam4 correction

The current implementation of the fnmam4 instruction template requires
the third source operand to be assigned the same hard register as the
target operand, but the constraint is not documented in the instruction
manual or standard template definitions. The current constraint will
generate additional data dependencies and extra instructions.

gcc/ChangeLog:

* config/loongarch/lasx.md (fnma<mode>4): Remove.
* config/loongarch/lsx.md (fnma<mode>4): Remove.
* config/loongarch/simd.md (fnma<mode>4): Simplify and correct.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/fnmam4-vec.c: New test.

(cherry picked from commit 7811fb6fa35fd3c3694eba34fbfc992eed1d3e67)

8 days agoDaily bump.
GCC Administrator [Thu, 30 Oct 2025 00:25:04 +0000 (00:25 +0000)] 
Daily bump.

9 days agoDaily bump.
GCC Administrator [Wed, 29 Oct 2025 00:24:16 +0000 (00:24 +0000)] 
Daily bump.

9 days agox86: Compile builtin-copysign-8b.c with -mtune=generic
H.J. Lu [Mon, 27 Oct 2025 10:11:25 +0000 (18:11 +0800)] 
x86: Compile builtin-copysign-8b.c with -mtune=generic

Compile builtin-copysign-8b.c with -mtune=generic so that it passes with

$ make check-gcc RUNTESTFLAGS="i386.exp=builtin-copysign-8b.c --target_board='unix{-m64\ -march=cascadelake}'"

PR target/122323
* gcc.target/i386/builtin-copysign-8b.c: Add -mtune=generic.

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

10 days agoDaily bump.
GCC Administrator [Tue, 28 Oct 2025 00:32:06 +0000 (00:32 +0000)] 
Daily bump.

11 days agoDaily bump.
GCC Administrator [Mon, 27 Oct 2025 00:27:29 +0000 (00:27 +0000)] 
Daily bump.

11 days agox86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax
LIU Hao [Sat, 25 Oct 2025 09:19:34 +0000 (17:19 +0800)] 
x86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax

Although there's no possibility of ambiguity, Intel manual says the mnemonic
for DWORD-to-QWORD sign-extension operation should be MOVSXD. Some assemblers
(GNU AS, NASM) also overload MOVSX, but some others don't accept MOVSX (LLVM,
MASM, YASM in NASM mode) and require MOVSXD.

This mnemonic was introduced in r0-34259-g123bf9e3f4056d in 2001, and has not
been updated ever since.

gcc/ChangeLog:

PR target/119079
* config/i386/i386.md: Use `movsxd` to perform SI-to-DI extension in Intel
syntax.

Signed-off-by: LIU Hao <lh_mouse@126.com>
(cherry picked from commit 66b38349273525dfb86f0f74d6c928abdbf7154f)

12 days ago[aarch64] [testsuite] tolerate alternate insn selection [PR121599]
Alexandre Oliva [Sun, 26 Oct 2025 01:45:22 +0000 (22:45 -0300)] 
[aarch64] [testsuite] tolerate alternate insn selection [PR121599]

On gcc-14, instead of 'movi\td[0-9]*,#0', we select
'mov\tz[0-9]*\.b,#0', and the testcase fails.
As in pfalse* tests, tolerate the difference.

for  gcc/testsuite/ChangeLog

PR target/121599
* gcc.target/aarch64/sve2/pr121599.c: Tolerate alterate insn
selection.

(cherry picked from commit ba653cb0d26e004c10d20ebd9f009a0a823659b0)

12 days agoDaily bump.
GCC Administrator [Sun, 26 Oct 2025 00:27:34 +0000 (00:27 +0000)] 
Daily bump.

13 days agoFortran: fix issue with I/O of array pointer [PR107968]
Harald Anlauf [Fri, 3 Oct 2025 19:16:19 +0000 (21:16 +0200)] 
Fortran: fix issue with I/O of array pointer [PR107968]

PR fortran/107968

gcc/fortran/ChangeLog:

* trans-io.cc (gfc_trans_transfer): Also scalarize I/O of section
of an array pointer.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit e3431c6fd4691d5a0c48ee78869e5f9a79f217c3)

13 days agoFortran: fix "unstable" interfaces of external procedures [PR122206]
Harald Anlauf [Thu, 9 Oct 2025 16:43:22 +0000 (18:43 +0200)] 
Fortran: fix "unstable" interfaces of external procedures [PR122206]

In the testcase repeated invocations of a function showed an apparently
unstable interface.  This was caused by trying to guess an (inappropriate)
interface of the external procedure after processing of the procedure
arguments in gfc_conv_procedure_call.  The mis-guessed interface showed up
in subsequent uses of the procedure symbol in gfc_conv_procedure_call.  The
solution is to check for an existing interface of an external procedure
before trying to wildly guess based on just the actual arguments.

PR fortran/122206

gcc/fortran/ChangeLog:

* trans-types.cc (gfc_get_function_type): Do not clobber an
existing procedure interface.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit c474a50b42ac3f7561f628916cf58810044986b3)

13 days agoDaily bump.
GCC Administrator [Sat, 25 Oct 2025 00:27:25 +0000 (00:27 +0000)] 
Daily bump.

2 weeks agox86: builtin-fabs-2.c: Also scan (%edi) for x32
H.J. Lu [Fri, 24 Oct 2025 08:23:19 +0000 (16:23 +0800)] 
x86: builtin-fabs-2.c: Also scan (%edi) for x32

Adjust gcc.target/i386/builtin-fabs-2.c to scan both (%rdi) and (%edi).

PR target/122323
* gcc.target/i386/builtin-fabs-2.c: Also scan (%edi)for x32.

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

2 weeks agox86: Optimize copysign (x, const_double)
H.J. Lu [Sun, 19 Oct 2025 01:13:52 +0000 (09:13 +0800)] 
x86: Optimize copysign (x, const_double)

After

commit 3f176e1adc6bc9cc2c21222d776b51d9f43cb66b
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Thu Nov 9 13:59:39 2023 +0000

    middle-end: optimize fneg (fabs (x)) to copysign (x, -1) [PR109154]

fneg (fabs (x)) is expanded to copysign (x, -1).  Swap constraints for
operands[1] and operands[2] in copysign<mode>3 pattern to optimize

  y = copysign (x, const_double)

instead of

  y = copysign (const_double, x)

Simplify

  y = copysign (x, positive_const_double)

to

  y = ~signbit_mask & x

and

  y = copysign (x, negative_const_double)

to

  y = signbit_mask | x

gcc/

PR target/99930
PR target/122323
* config/i386/i386-expand.cc (ix86_expand_copysign): Swap
operands[1] with operands[2].  Optimize copysign (x, const_double)
instead of copysign (const_double, x).
* config/i386/i386.md (copysign<mode>3): Swap constraints for
operands[1] and operands[2].

gcc/testsuite/

PR target/99930
PR target/122323
* gcc.target/i386/builtin-copysign-2.c: New test.
* gcc.target/i386/builtin-copysign-3.c: Likewise.
* gcc.target/i386/builtin-copysign-4.c: Likewise.
* gcc.target/i386/builtin-copysign-5.c: Likewise.
* gcc.target/i386/builtin-copysign-6.c: Likewise.
* gcc.target/i386/builtin-copysign-7.c: Likewise.
* gcc.target/i386/builtin-copysign-8a.c: Likewise.
* gcc.target/i386/builtin-copysign-8b.c: Likewise.
* gcc.target/i386/builtin-fabs-1.c: Likewise.
* gcc.target/i386/builtin-fabs-2.c: Likewise.

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

2 weeks agoDaily bump.
GCC Administrator [Fri, 24 Oct 2025 00:28:48 +0000 (00:28 +0000)] 
Daily bump.

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

2 weeks agoi386: Correct cpu codename value for unknown model number
Haochen Jiang [Tue, 21 Oct 2025 03:21:45 +0000 (11:21 +0800)] 
i386: Correct cpu codename value for unknown model number

There are several changes for features enabled on cpus. r16-1666 disabled
CLDEMOTE on clients. r16-2224 removed Key locker since Panther Lake and
Clearwater forest. r16-4436 disabled PREFETCHI on Panther Lake.

The patches caused the current return guess value not aligned for
host_detect_local_cpu meeting the unknown model number. Correct the
logic according to the features enabled.

This patch will also backport to GCC14 and GCC15.

gcc/ChangeLog:

* config/i386/driver-i386.cc (host_detect_local_cpu): Correct
the logic for unknown model number cpu guess value.

2 weeks agoDaily bump.
GCC Administrator [Wed, 22 Oct 2025 00:27:48 +0000 (00:27 +0000)] 
Daily bump.

2 weeks agoaarch64: Fix ICE when op2 is zero for SVE2 saturating add intrinsics.
Jennifer Schmitz [Thu, 21 Aug 2025 17:01:49 +0000 (10:01 -0700)] 
aarch64: Fix ICE when op2 is zero for SVE2 saturating add intrinsics.

When op2 in SVE2 saturating add intrinsics (svuqadd, svsqadd) is a zero
vector and predication is _z, an ICE in vregs occurs, e.g. for

svuint8_t foo (svbool_t pg, svuint8_t op1)
{
    return svsqadd_u8_z (pg, op1, svdup_s8 (0));
}

The insn failed to match the pattern (aarch64-sve2.md):

;; Predicated binary operations with no reverse form, merging with zero.
;; At present we don't generate these patterns via a cond_* optab,
;; so there's no correctness requirement to handle merging with an
;; independent value.
(define_insn_and_rewrite "*cond_<sve_int_op><mode>_z"
  [(set (match_operand:SVE_FULL_I 0 "register_operand")
(unspec:SVE_FULL_I
  [(match_operand:<VPRED> 1 "register_operand")
   (unspec:SVE_FULL_I
     [(match_operand 5)
      (unspec:SVE_FULL_I
[(match_operand:SVE_FULL_I 2 "register_operand")
 (match_operand:SVE_FULL_I 3 "register_operand")]
SVE2_COND_INT_BINARY_NOREV)]
     UNSPEC_PRED_X)
   (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_zero")]
  UNSPEC_SEL))]
  "TARGET_SVE2"
  {@ [ cons: =0 , 1   , 2 , 3  ]
     [ &w       , Upl , 0 , w  ] movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
     [ &w       , Upl , w , w  ] movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
  }
  "&& !CONSTANT_P (operands[5])"
  {
    operands[5] = CONSTM1_RTX (<VPRED>mode);
  }
  [(set_attr "movprfx" "yes")]
)

because operands[3] and operands[4] were both expanded into the same register
operand containing a zero vector by define_expand "@cond_<sve_int_op><mode>".

This patch fixes the ICE by making a case distinction in
function_expander::use_cond_insn that uses add_fixed_operand if
fallback_arg == CONST0_RTX (mode), and otherwise add_input_operand (which was
previously the default and allowed the expansion of the zero-vector
fallback_arg to a register operand).

The patch was bootstrapped and tested on aarch64-linux-gnu, no regression.
OK for trunk?

Alex Coplan pointed out in the bugzilla ticket that this ICE goes back
to GCC 10. Shall we backport?

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
Co-authored by: Richard Sandiford <rdsandiford@googlemail.com>

gcc/
PR target/121599
* config/aarch64/aarch64-sve-builtins.cc
(function_expander::use_cond_insn): Use add_fixed_operand if
fallback_arg == CONST0_RTX (mode).

gcc/testsuite/
PR target/121599
* gcc.target/aarch64/sve2/pr121599.c: New test.

2 weeks agoinput: give file_cache_slot its own copy of the file path [PR118919]
David Malcolm [Wed, 19 Feb 2025 14:46:43 +0000 (09:46 -0500)] 
input: give file_cache_slot its own copy of the file path [PR118919]

input.cc's file_cache was borrowing copies of the file name.
This could lead to use-after-free when writing out sarif output
from Fortran, which frees its filenames before the sarif output
is fully written out.

Fix by taking a copy in file_cache_slot.

gcc/ChangeLog:
PR other/118919
* input.cc (file_cache_slot::m_file_path): Make non-const.
(file_cache_slot::evict): Free m_file_path.
(file_cache_slot::create): Store a copy of file_path if non-null.
(file_cache_slot::~file_cache_slot): Free m_file_path.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
(cherry picked from commit ee6619b1246b38cfb36f6efd931a6f475a9033c7)

2 weeks agoanalyzer: handle more IFN_UBSAN_* as no-ops [PR118300]
David Malcolm [Wed, 19 Feb 2025 14:44:46 +0000 (09:44 -0500)] 
analyzer: handle more IFN_UBSAN_* as no-ops [PR118300]

Previously the analyzer treated IFN_UBSAN_BOUNDS as a no-op, but
the other IFN_UBSAN_* were unrecognized and conservatively treated
as having arbitrary behavior.

Treat IFN_UBSAN_NULL and IFN_UBSAN_PTR also as no-ops, which should
make -fanalyzer behave better with -fsanitize=undefined.

gcc/analyzer/ChangeLog:
PR analyzer/118300
* kf.cc (class kf_ubsan_bounds): Replace this with...
(class kf_ubsan_noop): ...this.
(register_sanitizer_builtins): Use it to handle IFN_UBSAN_NULL,
IFN_UBSAN_BOUNDS, and IFN_UBSAN_PTR as nop-ops.
(register_known_functions): Drop handling of IFN_UBSAN_BOUNDS
here, as it's now handled by register_sanitizer_builtins above.

gcc/testsuite/ChangeLog:
PR analyzer/118300
* gcc.dg/analyzer/ubsan-pr118300.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
(cherry picked from commit 58b90139e093aeb5494627d92257a97aebb4a6d9)

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

2 weeks agohurd: Add OPTION_GLIBC_P and OPTION_GLIBC
Svante Signell [Sun, 6 Feb 2022 11:43:23 +0000 (11:43 +0000)] 
hurd: Add OPTION_GLIBC_P and OPTION_GLIBC

GNU/Hurd uses glibc just like GNU/Linux.

This is needed for gcc to notice that glibc supports split stack in
finish_options.

PR go/104290
gcc/ChangeLog:
* config/gnu.h (OPTION_GLIBC_P, OPTION_GLIBC): Define.

(cherry picked from commit 29eacf043b6e8560c5c42d67f7f9b11e4e2cb156)

2 weeks agolibstdc++: Remove undeclared macros from configure.ac [PR122322]
Jonathan Wakely [Sat, 18 Oct 2025 21:05:43 +0000 (22:05 +0100)] 
libstdc++: Remove undeclared macros from configure.ac [PR122322]

The additions in r16-4443-g651bf5126da124 cause errors when running
autoreconf.

libstdc++-v3/ChangeLog:

PR libstdc++/122322
* configure.ac (with_newlib) <*-rtems*>: Remove
HAVE_SYS_IOCT4YL_H, _GLIBCXX_USE_LINK, _GLIBCXX_USE_READLINK,
_GLIBCXX_USE_SYMLINK, _GLIBCXX_USE_TRUNCATE, and
_GLIBCXX_USE_FDOPENDIR. Remove duplicates.
* configure: Regenerate.

(cherry picked from commit f5fb192c65e618508108525252b771956bdb1078)

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:23:36 +0000 (00:23 +0000)] 
Daily bump.

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

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

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

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 agoaarch64, testsuite: Add -fchecking to test options [PR121772]
Alex Coplan [Mon, 13 Oct 2025 13:41:09 +0000 (13:41 +0000)] 
aarch64, testsuite: Add -fchecking to test options [PR121772]

I noticed while testing a backport of the PR121772 fix to GCC 13 that
the test wasn't triggering the ICE as expected with the unpatched
compiler.

This turned out to be because the ICE is a checking ICE, and we
configure by default with --enable-checking=release on the branches.
Additionally, I hadn't noticed when doing the backports to 15 and 14
since there we still ICE later on in emit_move_insn even if we don't
catch the invalid gimple with checking.

I'm not too sure why the 13 branch doesn't see the emit_move_insn ICE,
but it's somewhat irrelevant - the important thing is that adding
-fchecking to the options makes the test fail as expected with an
unpatched compiler (i.e. with a gimple checking failure), even on
release branches.

I considered applying this patch to just the release branches, but
figured that trunk will at some point itself become a release branch, so
it seems to make most sense just to apply it everywhere.

I've checked that the test still passes with this patch, and still fails
if I revert the PR121772 fix.

gcc/testsuite/ChangeLog:

PR tree-optimization/121772
* gcc.target/aarch64/torture/pr121772.c: Add -fchecking to
dg-options.

(cherry picked from commit 0c670d38455c788ac0447e3b86ba621521d44bce)

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

3 weeks agolibstdc++: Enable features for RTEMS (based on GCC 15)
Joel Sherrill [Wed, 15 Oct 2025 15:05:54 +0000 (10:05 -0500)] 
libstdc++: Enable features for RTEMS (based on GCC 15)

libstdc++-v3/ChangeLog:

* configure: Regenerate.
* configure.ac (newlib, *-rtems*): Add HAVE_SYS_IOCTL_H,
HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H, HAVE_S_ISREG, HAVE_UNISTD_H,
HAVE_UNLINKAT, _GLIBCXX_USE_CHMOD, _GLIBCXX_USE_MKDIR,
_GLIBCXX_USE_CHDIR, _GLIBCXX_USE_GETCWD, _GLIBCXX_USE_UTIME,
_GLIBCXX_USE_LINK, _GLIBCXX_USE_READLINK, _GLIBCXX_USE_SYMLINK,
_GLIBCXX_USE_TRUNCATE and _GLIBCXX_USE_FDOPENDIR.

3 weeks agoaarch64: Fix pmsdsfr_el1 encoding
Alice Carlotti [Wed, 15 Oct 2025 13:14:43 +0000 (14:14 +0100)] 
aarch64: Fix pmsdsfr_el1 encoding

The encoding was fixed in Binutils in May 2024, but we didn't copy the
fix to GCC at the time.

gcc/ChangeLog:

* config/aarch64/aarch64-sys-regs.def: Fix pmsdsfr_el1 encoding.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/acle/rwsr-armv8p9.c: Fix pmsdsfr_el1
encoding.

3 weeks agoi386: Correct ISA set for Panther Lake
Haochen Jiang [Wed, 15 Oct 2025 06:08:32 +0000 (14:08 +0800)] 
i386: Correct ISA set for Panther Lake

In ISE, Panther Lake does not enable PREFETCHI. Correct them
accordingly.

gcc/ChangeLog:

* config/i386/i386.h
(PTA_PANTHERLAKE): Remove PREFETCHI.
* doc/invoke.texi: Correct documentation.

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

3 weeks agoc++: pointer to auto member function [PR120757]
Jason Merrill [Tue, 14 Oct 2025 20:27:57 +0000 (23:27 +0300)] 
c++: pointer to auto member function [PR120757]

Here r13-1210 correctly changed &A<int>::foo to not be considered
type-dependent, but tsubst_expr of the OFFSET_REF got confused trying to
tsubst a type that involved auto.  Fixed by getting the type from the
member rather than tsubst.

PR c++/120757

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr) [OFFSET_REF]: Don't tsubst the type.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/auto-fn66.C: New test.

(cherry picked from commit ea6ef13d0fc4e020d8c405333153dad9eee1f18d)

3 weeks agogimplify: Fix up side-effect handling in 2nd __builtin_c[lt]zg argument [PR122188]
Jakub Jelinek [Thu, 9 Oct 2025 16:06:39 +0000 (18:06 +0200)] 
gimplify: Fix up side-effect handling in 2nd __builtin_c[lt]zg argument [PR122188]

The patch from yesterday made me think about side-effects in the second
argument of __builtin_c[lt]zg.  When we change
__builtin_c[lt]zg (x, y)
when y is not INTEGER_CST into
x ? __builtin_c[lt]zg (x) : y
with evaluating x only once, we omit the side-effects in y unless x is not
0.  That looks undesirable, we should evaluate side-effects in y
unconditionally.

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

PR c/122188
* c-gimplify.cc (c_gimplify_expr): Also gimplify the second operand
before the COND_EXPR and use in COND_EXPR result of gimplification.

* gcc.dg/torture/pr122188.c: New test.

(cherry picked from commit 579de8f5295b05573d05f6e4102f1428f35c9f17)

3 weeks agogimplify: Fix up __builtin_c[lt]zg gimplification [PR122188]
Jakub Jelinek [Wed, 8 Oct 2025 07:58:41 +0000 (09:58 +0200)] 
gimplify: Fix up __builtin_c[lt]zg gimplification [PR122188]

The following testcase ICEs during gimplification.
The problem is that save_expr sometimes doesn't create a SAVE_EXPR but
returns the original complex tree (COND_EXPR) and the code then uses that
tree in 2 different spots without unsharing.  As this is done during
gimplification it wasn't unshared when whole body is unshared and because
gimplification is destructive, the first time we gimplify it we destruct it
and second time we try to gimplify it we ICE on it.
Now, we could replace one a use with unshare_expr (a), but because this
is a gimplification hook, I think easier than trying to create a save_expr
is just gimplify the argument, then we know it is is_gimple_val and so
something without side-effects and can safely use it twice.  That argument
would be the first thing to gimplify after return GS_OK anyway, so it
doesn't change argument sequencing etc.

2025-10-08  Jakub Jelinek  <jakub@redhat.com>

PR c/122188
* c-gimplify.cc (c_gimplify_expr): Gimplify CALL_EXPR_ARG (*expr_p, 0)
instead of calling save_expr on it.

* c-c++-common/pr122188.c: New test.

(cherry picked from commit bb22f7d4d63446c9095db32ca013a9b2182df7d9)

3 weeks agowidening_mul: Reset flow sensitive info in maybe_optimize_guarding_check [PR122104]
Jakub Jelinek [Sat, 4 Oct 2025 15:06:16 +0000 (17:06 +0200)] 
widening_mul: Reset flow sensitive info in maybe_optimize_guarding_check [PR122104]

In PR95852 I've added an optimization where next to just pattern
recognizing r = x * y; r / x != y or r = x * y; r / x == y
as .MUL_OVERFLOW or negation thereof it also recognizes
r = x * y; x && (r / x != y) or r = x * y; !x || (r / x == y)
by optimizing the guarding condition to always true/false.

The problem with that is that some value ranges recorded for
the SSA_NAMEs in the formerly conditional, now unconditional
basic block can be invalid.

This patch fixes it by calling reset_flow_sensitive_info_in_bb
if we optimize the guarding condition.

2025-10-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/122104
* tree-ssa-math-opts.cc (maybe_optimize_guarding_check): Call
reset_flow_sensitive_info_in_bb on bb when optimizing out the
guarding condition.

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

(cherry picked from commit 867f777cee9f44027a3724fbad266c5cfb3a311f)

3 weeks agoopenmp: Fix up ICE in lower_omp_regimplify_operands_p [PR121977]
Jakub Jelinek [Thu, 18 Sep 2025 14:41:32 +0000 (16:41 +0200)] 
openmp: Fix up ICE in lower_omp_regimplify_operands_p [PR121977]

The following testcase ICEs in functions called from
lower_omp_regimplify_operands_p, because maybe_lookup_decl returns
NULL for this (on the outer taskloop context) when regimplifying the
taskloop pre body.  If it isn't found in current context, we should
look in outer ones.

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

PR c++/121977
* omp-low.cc (lower_omp_regimplify_operands_p): If maybe_lookup_decl
returns NULL, use maybe_lookup_decl_in_outer_ctx as fallback.

* g++.dg/gomp/pr121977.C: New test.

(cherry picked from commit b49f1dad54d3638384780c11ed17ab43f6d5d86f)

3 weeks agobitint: Fix up lowering optimization of .*_OVERFLOW ifns [PR121828]
Jakub Jelinek [Wed, 10 Sep 2025 10:34:50 +0000 (12:34 +0200)] 
bitint: Fix up lowering optimization of .*_OVERFLOW ifns [PR121828]

THe lowering of .{ADD,SUB,MUL}_OVERFLOW ifns is optimized, so that we don't
in the common cases uselessly don't create a large _Complex _BitInt
temporary with the first (real) part being the result and second (imag) part
just being a huge 0 or 1, although we still do that if it can't be done.
The optimizable_arith_overflow function checks when that is possible, like
whether the ifn result is used at most twice, once in REALPART_EXPR and once
in IMAGPART_EXPR in the same bb, etc.  For IMAGPART_EXPR it then checks
if it has a single use which is a cast to some integral non-bitint type
(usually bool or int etc.).  The final check is whether that cast stmt
appears after the REALPART_EXPR (the usual case), in that case it is
optimizable, otherwise it is not (because the lowering for optimizable
ifns of this kind is done at the location of the REALPART_EXPR and it
tweaks the IMAGPART_EXPR cast location at that point, so otherwise it
would be set after use.

Now, we also have an optimization for the REALPART_EXPR lhs being used
in a single stmt - store in the same bb, in that case we don't have to
store the real part result in a temporary but it can go directly into
memory.
Except that nothing checks for the IMAGPART_EXPR cast being before or after
the store in this case, so the following testcase ICEs because we have
a use before a def stmt.

In bar (the function handled right already before this patch) we have
  _6 = .SUB_OVERFLOW (y_4(D), x_5(D));
  _1 = REALPART_EXPR <_6>;
  _2 = IMAGPART_EXPR <_6>;
  a = _1;
  _3 = (int) _2;
  baz (_3);
before the lowering, so we can just store the limbs of the .SUB_OVERFLOW
into the limbs of a variable and while doing that compute the value we
eventually store into _3 instead of the former a = _1; stmt.
In foo we have
  _5 = .SUB_OVERFLOW (y_3(D), x_4(D));
  _1 = REALPART_EXPR <_5>;
  _2 = IMAGPART_EXPR <_5>;
  t_6 = (int) _2;
  baz (t_6);
  a = _1;
and we can't do that because the lowering would be at the a = _1; stmt
and would try to set t_6 to the overflow flag at that point.  We don't
need to punt completely and mark _5 as _Complex _BitInt VAR_DECL though
in this case, all we need is not merge the a = _1; store with the
.SUB_OVERFLOW and REALPART_EXPR/IMAGPART_EXPR lowering.  So, add _1
to m_names and lower the first 3 stmts at the _1 = REALPART_EXPR <_5>;
location, optimizable_arith_overflow returned non-zero and so the
cast after IMAGPART_EXPR was after it and then a = _1; will copy from
the temporary VAR_DECL to memory.

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

PR middle-end/121828
* gimple-lower-bitint.cc (gimple_lower_bitint): For REALPART_EXPR
consumed by store in the same bb and with REALPART_EXPR from
optimizable_arith_overflow, don't add REALPART_EXPR lhs to
the m_names bitmap only if the cast from IMAGPART_EXPR doesn't
appear in between the REALPART_EXPR and the store.

* gcc.dg/bitint-126.c: New test.

(cherry picked from commit 29a8ce3b0bb117ed7f4b998462fe917f2a17f168)

3 weeks agolibstdc++: Fix up <ext/pointer.h> [PR121827]
Jakub Jelinek [Mon, 8 Sep 2025 09:49:58 +0000 (11:49 +0200)] 
libstdc++: Fix up <ext/pointer.h> [PR121827]

During the tests mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692482.html
(but dunno why I haven't noticed it back in August but only when testing
https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694527.html )
I've noticed two ext header problems.
One is that #include <ext/pointer.h> got broken with the
r13-3037-g18f176d0b25591e28 change and since then is no longer
self-contained, as it includes iosfwd only if _GLIBCXX_HOSTED is defined
but doesn't actually include bits/c++config.h to make sure it is defined,
then includes a bunch of headers which do include bits/c++config.h and
finally uses in #if _GLIBCXX_HOSTED guarded code what is declared in iosfwd.
The other problem is that ext/cast.h is also not a self-contained header,
but that one has
/** @file ext/cast.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{ext/pointer.h}
 */
comment, so I think we just shouldn't include it in extc++.h and let
ext/pointer.h include it.

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

PR libstdc++/121827
* include/precompiled/extc++.h: Don't include ext/cast.h which is an
internal header.
* include/ext/pointer.h: Include bits/c++config.h before
#if _GLIBCXX_HOSTED.

(cherry picked from commit 592bafb26eb1fd50979f6cdf2176897c4a02c281)

3 weeks agotestsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]
Jakub Jelinek [Fri, 5 Sep 2025 08:59:42 +0000 (10:59 +0200)] 
testsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]

On Tue, Jul 01, 2025 at 02:50:40PM -0500, Segher Boessenkool wrote:
> No tests become good tests without effort.  And tests that are not good
> tests require constant maintenance!

Here are two patches, either just the first one or both can be used
and both were tested on powerpc64le-linux.

The second one adds further 8 tests, which are dg-do run which #include
the former tests, don't do any dump tests and just define the checking/main
for those.

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

PR testsuite/118567
* gcc.target/powerpc/vsx-vectorize-9.c: New test.
* gcc.target/powerpc/vsx-vectorize-10.c: New test.
* gcc.target/powerpc/vsx-vectorize-11.c: New test.
* gcc.target/powerpc/vsx-vectorize-12.c: New test.
* gcc.target/powerpc/vsx-vectorize-13.c: New test.
* gcc.target/powerpc/vsx-vectorize-14.c: New test.
* gcc.target/powerpc/vsx-vectorize-15.c: New test.
* gcc.target/powerpc/vsx-vectorize-16.c: New test.

(cherry picked from commit 8d8b6249d83609e56752ee51d2686b2f5fb062e6)

3 weeks agotestsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]
Jakub Jelinek [Fri, 5 Sep 2025 08:54:53 +0000 (10:54 +0200)] 
testsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]

On Tue, Jul 01, 2025 at 02:50:40PM -0500, Segher Boessenkool wrote:
> No tests become good tests without effort.  And tests that are not good
> tests require constant maintenance!

Here are two patches, either just the first one or both can be used
and both were tested on powerpc64le-linux.

The first one removes all the checking etc. stuff from the testcases,
as they are just dg-do compile, for the vectorize dump checks all we
care about are the vectorized loops they want to test.

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

PR testsuite/118567
* gcc.target/powerpc/vsx-vectorize-1.c: Remove includes, checking
part of main1 and main.
* gcc.target/powerpc/vsx-vectorize-2.c: Remove includes, replace
bar definition with declaration, remove main.
* gcc.target/powerpc/vsx-vectorize-3.c: Likewise.
* gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
* gcc.target/powerpc/vsx-vectorize-5.c: Likewise.
* gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
* gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
* gcc.target/powerpc/vsx-vectorize-8.c: Likewise.

(cherry picked from commit 193b28649933685f4dd3824c01aee4f843cc66b5)

3 weeks agoomp-expand: Initialize fd->loop.n2 if needed for the zero iter case [PR121453]
Jakub Jelinek [Mon, 25 Aug 2025 22:28:10 +0000 (00:28 +0200)] 
omp-expand: Initialize fd->loop.n2 if needed for the zero iter case [PR121453]

When expand_omp_for_init_counts is called from expand_omp_for_generic,
zero_iter1_bb is NULL and the code always creates a new bb in which it
clears fd->loop.n2 var (if it is a var), because it can dominate code
with lastprivate guards that use the var.
When called from other places, zero_iter1_bb is non-NULL and so we don't
insert the clearing (and can't, because the same bb is used also for the
non-zero iterations exit and in that case we need to preserve the iteration
count).  Clearing is also not necessary when e.g. outermost collapsed
loop has constant non-zero number of iterations, in that case we initialize the
var to something already earlier.  The following patch makes sure to clear
it if it hasn't been initialized yet before the first check for zero iterations.

2025-08-26  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/121453
* omp-expand.cc (expand_omp_for_init_counts): Clear fd->loop.n2
before first zero count check if zero_iter1_bb is non-NULL upon
entry and fd->loop.n2 has not been written yet.

* gcc.dg/gomp/pr121453.c: New test.

(cherry picked from commit 948f20cc520e50968f8759b173096358dcbba3de)

3 weeks agoDeal with prior EH/abormal cleanup when fixing up noreturn calls
Richard Biener [Wed, 10 Sep 2025 15:14:07 +0000 (17:14 +0200)] 
Deal with prior EH/abormal cleanup when fixing up noreturn calls

When a dead EH or abnormal edge makes a call queued for noreturn fixup
unreachable, just skip processing it.

PR tree-optimization/121870
* tree-ssa-propagate.cc
(substitute_and_fold_engine::substitute_and_fold): Skip
removed stmts from noreturn fixup.

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

(cherry picked from commit 5c4f1313e753aeb6920a48c62c7c99ad36e1adae)

3 weeks agotree-optimization/121370 - avoid UB in building a CHREC
Richard Biener [Tue, 5 Aug 2025 06:59:18 +0000 (08:59 +0200)] 
tree-optimization/121370 - avoid UB in building a CHREC

When there is obvious UB involved in the process of re-associating
a series of IV increments to build up a CHREC, fail.  This catches
a few degenerate cases where SCEV introduces UB with its inherent
re-associating of IV increments.

PR tree-optimization/121370
* tree-scalar-evolution.cc (scev_dfs::add_to_evolution_1):
Avoid UB integer overflow in accumulating CHREC_RIGHT.

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

(cherry picked from commit afafae097232e700bb7a74a453a048b83ebefccd)

3 weeks agotree-optimization/121256 - properly support SLP in vectorizable recurrence
Richard Biener [Sun, 27 Jul 2025 16:42:25 +0000 (18:42 +0200)] 
tree-optimization/121256 - properly support SLP in vectorizable recurrence

We failed to build the correct initialization vector.  For VLA
vectors and a non-uniform initialization vector this rejects
vectorization for now.

PR tree-optimization/121256
* tree-vect-loop.cc (vectorizable_recurr): Build a correct
initialization vector for SLP_TREE_LANES > 1.

* gcc.dg/vect/vect-recurr-pr121256.c: New testcase.
* gcc.dg/vect/vect-recurr-pr121256-2.c: Likewise.

(cherry picked from commit 26dc9aa285b53551c55d3d660bb6da21d59d7023)

3 weeks agotree-optimization/121059 - fixup loop mask query
Richard Biener [Mon, 14 Jul 2025 12:09:28 +0000 (14:09 +0200)] 
tree-optimization/121059 - fixup loop mask query

When we opportunistically mask an operand of a AND with an already
available loop mask we need to query that set with the correct number
of masks we expect.

PR tree-optimization/121059
* tree-vect-stmts.cc (vectorizable_operation): Query
scalar_cond_masked_set with the correct number of masks.

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

Co-Authored-By: Richard Sandiford <richard.sandiford@arm.com>
(cherry picked from commit 71be87055548cf942c7bc56d10ffd479db8569e4)

3 weeks agotree-optimization/120944 - bogus VN with volatile copies
Richard Biener [Fri, 4 Jul 2025 07:08:19 +0000 (09:08 +0200)] 
tree-optimization/120944 - bogus VN with volatile copies

The following avoids translating expressions through volatile
copies.

PR tree-optimization/120944
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Gate optimizations
invalid when volatile is involved.

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

(cherry picked from commit 6ed1e2ae1a742d859c2dd74c9e7cebdd3618e8b1)

3 weeks agotestsuite: add sve hw check to testcase [PR120817]
Tamar Christina [Mon, 7 Jul 2025 16:05:01 +0000 (17:05 +0100)] 
testsuite: add sve hw check to testcase [PR120817]

Drop down from SVE2 to SVE1 as that's the minimum
required for the test, and since it's a mid-end test
add the aarch64_sve_hw check.

gcc/testsuite/ChangeLog:

PR tree-optimization/120817
* gcc.dg/vect/pr120817.c: Add SVE HW check.

(cherry picked from commit 4b9f760c511a4ef3a390dd6cfab80bada57c2535)

3 weeks agotree-optimization/120817 - bogus DSE of .MASK_STORE
Richard Biener [Mon, 7 Jul 2025 07:56:50 +0000 (09:56 +0200)] 
tree-optimization/120817 - bogus DSE of .MASK_STORE

DSE used ao_ref_init_from_ptr_and_size for .MASK_STORE but
alias-analysis will use the specified size to disambiguate
against smaller objects.  For .MASK_STORE we instead have to
make the access size unspecified but we can still constrain
the access extent based on the maximum size possible.

PR tree-optimization/120817
* tree-ssa-dse.cc (initialize_ao_ref_for_dse): Use
ao_ref_init_from_ptr_and_range with unknown size for
.MASK_STORE and .MASK_LEN_STORE.

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

(cherry picked from commit 439b14e222571da76da2bfec04b9035fb9f1862d)

3 weeks agotree-optimization/120654 - ICE with range query from IVOPTs
Richard Biener [Fri, 20 Jun 2025 09:14:38 +0000 (11:14 +0200)] 
tree-optimization/120654 - ICE with range query from IVOPTs

The following ICEs as we hand down an UNDEFINED range to where it
isn't expected.  Put the guard that's there earlier.

PR tree-optimization/120654
* vr-values.cc (range_fits_type_p): Check for undefined_p ()
before accessing type ().

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

(cherry picked from commit 6bd1223bd55ed60fa5dbfd4a8444e133e5e933f5)

3 weeks agotree-optimization/120358 - bogus PTA with structure access
Richard Biener [Mon, 7 Jul 2025 13:13:38 +0000 (15:13 +0200)] 
tree-optimization/120358 - bogus PTA with structure access

When we compute the constraint for something like
MEM[(const struct QStringView &)&tok2 + 32] we go and compute
what (const struct QStringView &)&tok2 + 32 points to and then
add subvariables to its dereference that possibly fall in the
range of the access according to the original refs size.  In
doing that we disregarded that the subvariable the starting
address points to might not be aligned to it and thus the
access might start at any point within that variable.  The following
conservatively adjusts the pruning of adjacent sub-variables to
honor this.

PR tree-optimization/120358
* tree-ssa-structalias.cc (get_constraint_for_1): Adjust
pruning of sub-variables according to the imprecise
known start offset.

(cherry picked from commit aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7)

3 weeks agotree-optimization/120357 - ICE with early break vectorization
Richard Biener [Fri, 30 May 2025 12:11:47 +0000 (14:11 +0200)] 
tree-optimization/120357 - ICE with early break vectorization

When doing early break vectorization of a loop with a conditional
reduction the epilog creation code is confused as to before which exit
to insert the conditional reduction induction IV update.  The
following make sure this is done before the main IV exit.

PR tree-optimization/120357
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Create
the conditional reduction induction IV increment before the
main IV exit.

* gcc.dg/vect/vect-early-break_136-pr120357.c: New testcase.

(cherry picked from commit dce4da51ab66c3abb84448326910cd42f6fe2499)

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

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

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

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

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

4 weeks agoAVR: target/122222 - Add modules for __floatsidf, __floatunsidf.
Georg-Johann Lay [Thu, 9 Oct 2025 16:35:34 +0000 (18:35 +0200)] 
AVR: target/122222 - Add modules for __floatsidf, __floatunsidf.

PR target/122222
libgcc/config/avr/libf7/
* libf7-asm.sx (D_floatsidf, D_floatunsidf): New modules.
* libf7-common.mk (F7_ASM_PARTS): Add D_floatsidf, D_floatunsidf.
(F7F, g_dx): Remove floatunsidf, floatsidf.
* libf7.c (f7_set_s32): Don't alias to f7_floatsidf.
(f7_set_u32): Don't alias to f7_floatunsidf.
* f7-renames.h: Rebuild
* f7-wraps.h: Rebuild.

gcc/testsuite/
* gcc.target/avr/pr122222-sitod.c: New test.

(cherry picked from commit 078208cf15bb373dc7931d6b373689cdff70cdc5)

4 weeks agoAVR: target/122220 - Let (int32_t) -0x1p31L return INT32_MIN.
Georg-Johann Lay [Thu, 9 Oct 2025 13:27:16 +0000 (15:27 +0200)] 
AVR: target/122220 - Let (int32_t) -0x1p31L return INT32_MIN.

PR target/122220
libgcc/config/avr/libf7/
* libf7-asm.sx (to_integer): Return 0x80... on negative overflow.

gcc/testsuite/
* gcc.target/avr/pr122220.c: New test.

(cherry picked from commit 3ea09e4d43278aa8d7b088a5f5438d921c48c411)

4 weeks agoAVR: target/122210 - Add double -> fixed-point conversions.
Georg-Johann Lay [Wed, 8 Oct 2025 18:02:53 +0000 (20:02 +0200)] 
AVR: target/122210 - Add double -> fixed-point conversions.

PR target/122210
libgcc/config/avr/libf7/
* libf7-common.mk (F7_ASM_PARTS): Add D2<fx> modules.
* libf7-asm.sx: Implement the D2<fx> modules.

gcc/testsuite/
* gcc.target/avr/dtofx.c: New test.

(cherry picked from commit b0bc615d9374ca6293996cf3afca8cabaca0defd)

4 weeks agoAVR: target/122210 - Add fixed-point -> double conversions.
Georg-Johann Lay [Wed, 8 Oct 2025 18:02:53 +0000 (20:02 +0200)] 
AVR: target/122210 - Add fixed-point -> double conversions.

PR target/122210
libgcc/config/avr/libf7/
* libf7-common.mk (F7_ASM_PARTS): Add <fx>2D modules.
* libf7-asm.sx: Implement the <fx>2D modules.

gcc/testsuite/
* gcc.target/avr/fxtod.c: New test.

(cherry picked from commit 7304e83f1f29c39df7a9de888d9c6d40b58c512a)

4 weeks agoAVR/LibF7: Implement sincos.
Georg-Johann Lay [Mon, 6 Oct 2025 19:31:46 +0000 (21:31 +0200)] 
AVR/LibF7: Implement sincos.

libgcc/config/avr/libf7/
* libf7-common.mk (F7_ASM_PARTS): Add D_sincos.
* libf7-asm.sx: (D_sincos): New module implements sincos / sincosl.

gcc/testsuite/
* gcc.target/avr/sincos-1.c: New test.

(cherry picked from commit e3a05e050226aaaa4e2a2e7aee1e5651212a68f6)

4 weeks agoAVR/LibF7: target/122177 - fix fmin / fmax return value for one NaN arg.
Georg-Johann Lay [Sun, 5 Oct 2025 18:56:56 +0000 (20:56 +0200)] 
AVR/LibF7: target/122177 - fix fmin / fmax return value for one NaN arg.

fmin and fmax should return the non-NaN argument in the case where
exactly one argument is a NaN.

Moreover, IEEE double fmin and fmax can be performed without
first converting the args to the internal representation and
then converting back again.

PR target/122177
libgcc/config/avr/libf7/
* libf7-common.mk (m_ddd): Remove: fmin, fmax.
(F7_ASM_PARTS): Add: D_fminfmax.
* libf7-asm.sx (D_fmanfmax): New module.
* f7-wraps.h: Rebuild.

gcc/testsuite/
* gcc.target/avr/fminfmax-1.c: New test.

(cherry picked from commit efb3cd64fdefab88c7787b16ad33be33f4c4a2a4)

4 weeks agoAVR: Speed up IEEE double comparisons.
Georg-Johann Lay [Sun, 5 Oct 2025 18:56:56 +0000 (20:56 +0200)] 
AVR: Speed up IEEE double comparisons.

IEEE double can be compared without first converting them to
the internal representation.

libgcc/config/avr/libf7/
* libf7-common.mk (g_xdd_cmp): Remove le, lt, ge, gt, ne, eq, unord.
(F7_ASM_PARTS): Add D_cmp, D_eq, D_ne, D_ge, D_gt, D_le, D_lt, D_unord.
* libf7-asm.sx (D_cmp, D_eq, D_ne, D_ge, D_gt, D_le, D_lt, D_unord):
New modules.
* f7-wraps.h: Rebuild.

gcc/testsuite/
* gcc.target/avr/cmpdi-1.c: New test.

(cherry picked from commit e5731a4bc50e95245cb628505142e0adff0bb79e)

4 weeks agoAVR: target/120442 - Support f7_fdim / fdiml in LibF7.
Georg-Johann Lay [Tue, 27 May 2025 10:03:13 +0000 (12:03 +0200)] 
AVR: target/120442 - Support f7_fdim / fdiml in LibF7.

Add Support for fdiml.
PR target/120442
libgcc/config/avr/libf7/
* libf7-common.mk (LIBF_C_PARTS, m_ddd): Add fdim.
* libf7.h (f7_fdim): New proto.
* libf7.c (f7_fdim): New function.
* f7renames.sh (f7_fdim): Add rename.
* f7-wraps.h: Rebuild
* f7-renames.h: Rebuild

(cherry picked from commit 6045de6596d09f3cf7ae3f552b56d7e5df17a899)

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

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

4 weeks agoAVR: target/122187 - Don't clobber recog_data.operand[] in insn out.
Georg-Johann Lay [Tue, 7 Oct 2025 15:50:34 +0000 (17:50 +0200)] 
AVR: target/122187 - Don't clobber recog_data.operand[] in insn out.

avr.cc::avr_out_extr() and avr.cc::avr_out_extr_not()
changed xop for output, which spoiled the operand for
the next invokation, running into an assertion.

This patch makes a local copy of the operands.

PR target/122187
gcc/
* config/avr/avr.cc (avr_out_extr, avr_out_extr_not):
Make a local copy of the passed rtx[] operands.

gcc/testsuite/
* gcc.target/avr/torture/pr122187.c: New test.

(cherry picked from commit 3cbd43d640d6384df85c171a0245488f0adc3145)

4 weeks agoc++: find_template_parameters and NTTPs [PR121981]
Patrick Palka [Sat, 20 Sep 2025 14:45:22 +0000 (10:45 -0400)] 
c++: find_template_parameters and NTTPs [PR121981]

Here the normal form of the two immediately-declared D<<placeholder>, V>
constraints is the same, so we rightfully share the normal form between
them.  We first compute the normal form from the context of auto deduction
for W in which case the placeholder has level 2 where the set of
in-scope template parameters has depth 2 (a dummy level is added from
normalize_placeholder_type_constraints).

Naturally the atomic constraint only depends on the template parameter
V of depth 1 index 0.  The depth 2 of current_template_parms however
means that find_template_parameters when it sees V within the atomic
constraint will recurse into its TREE_TYPE, an auto of level 2, and mark
the atomic constraint as also depending on the template parameter of
depth 2 index 0, which is clearly wrong.  Later during constraint
checking for B we ICE within the satisfaction cache since we lack two
levels of template arguments supposedly needed by the cached atomic
constraint.

I think when find_template_parameters sees an NTTP, it doesn't need to
walk its TREE_TYPE because NTTP substitution is done obliviously with
respect to its type -- only the corresponding NTTP argument matters,
not other template arguments possibly used within its type.  This is
most clearly true for (unconstrained) auto NTTPs as in the testcase, but
also true for other NTTPs.  Doing so fixes the testcase because we no
longer record any depth 2 when walking V within the atomic constraint.

PR c++/121981

gcc/cp/ChangeLog:

* pt.cc (any_template_parm_r) <case TEMPLATE_TYPE_PARM>:
Don't walk TREE_TYPE.

gcc/testsuite/ChangeLog:

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

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit 396e9118849c4b918eaf3edcfa60d36e2b973019)

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

4 weeks agolibstdc++: Fix FAIL: 20_util/ratio/operations/ops_overflow_neg.cc [PR122168]
Jonathan Wakely [Mon, 6 Oct 2025 11:16:37 +0000 (12:16 +0100)] 
libstdc++: Fix FAIL: 20_util/ratio/operations/ops_overflow_neg.cc [PR122168]

This backports the additional dg-error added by r15-3859-g63a598deb0c9fc
which is now also needed on gcc-14 due to r14-12048-g9c3777e9619ad3
having been backported.

libstdc++-v3/ChangeLog:

PR libstdc++/122168
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Add
dg-error for additional error seen with -Wsystem-headers.

4 weeks agoDaily bump.
GCC Administrator [Mon, 6 Oct 2025 00:21:57 +0000 (00:21 +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:54:29 +0000 (16:54 +0000)] 
Daily bump.

4 weeks agoAdd testcase for PR ada/113536
Eric Botcazou [Sun, 5 Oct 2025 08:42:25 +0000 (10:42 +0200)] 
Add testcase for PR ada/113536

gcc/testsuite/
PR ada/113536
* gnat.dg/reduce2.adb: New test.

4 weeks agoada: Error in determining accumulator subtype for a reduction expression
Steve Baird [Wed, 7 Feb 2024 21:52:58 +0000 (13:52 -0800)] 
ada: Error in determining accumulator subtype for a reduction expression

There was an earlier bug in determining the accumulator subtype for a
reduction expression in the case where the reducer subprogram is overloaded.
The fix for that bug introduced a recently-discovered
regression. Redo accumulator subtype computation in order to address
this regression while preserving the benefits of the earlier fix.

gcc/ada/
PR ada/113536
* exp_attr.adb: Move computation of Accum_Typ entirely into the
function Build_Stat.

5 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]

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)

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

5 weeks agolibstdc++/testsuite: Unpoison 'u' on s390x in names.cc test
Patrick Palka [Wed, 24 Sep 2025 02:41:26 +0000 (22:41 -0400)] 
libstdc++/testsuite: Unpoison 'u' on s390x in names.cc test

This is the s390 counterpart to r11-7364-gd0453cf5c68b6a, and fixes the
following names.cc failure caused by a use of a poisoned identifier.
If we look at the corresponding upstream header[1] it's clear that the
problematic identifier is 'u'.

In file included from /usr/include/linux/types.h:5,
                 from /usr/include/linux/sched/types.h:5,
                 from /usr/include/bits/sched.h:61,
                 from /usr/include/sched.h:43,
                 from /usr/include/pthread.h:22,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/gthr-default.h:35,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/stdc++.h:54,
                 from /root/rpmbuild/BUILD/gcc-14.3.1-20250617/libstdc++-v3/testsuite/17_intro/names.cc:384:
/usr/include/asm/types.h:24: error: expected unqualified-id before '[' token
/usr/include/asm/types.h:24: error: expected ')' before '[' token
/root/rpmbuild/BUILD/gcc-14.3.1-20250617/libstdc++-v3/testsuite/17_intro/names.cc:101: note: to match this '('
compiler exited with status 1
FAIL: 17_intro/names.cc  -std=gnu++98 (test for excess errors)
Excess errors:
/usr/include/asm/types.h:24: error: expected unqualified-id before '[' token
/usr/include/asm/types.h:24: error: expected ')' before '[' token

[1]: https://github.com/torvalds/linux/blob/master/arch/s390/include/uapi/asm/types.h

libstdc++-v3/ChangeLog:

* testsuite/17_intro/names.cc: Undefine 'u' on s390*-linux.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit e9f3138f38067664bae25947ebabc0e8fa223d43)

5 weeks agolibstdc++: Explicitly pass -Wsystem-headers in tests that need it
Patrick Palka [Wed, 17 Sep 2025 01:00:50 +0000 (21:00 -0400)] 
libstdc++: Explicitly pass -Wsystem-headers in tests that need it

When running libstdc++ tests using an installed gcc (as opposed to an
in-tree gcc), we naturally use system stdlib headers instead of the
in-tree headers.  But warnings from within system headers are suppressed
by default, so tests that check for such warnings spuriously fail in such
a setup.  This patch makes us compile such tests with -Wsystem-headers so
that they consistently pass.

libstdc++-v3/ChangeLog:

* testsuite/20_util/bind/dangling_ref.cc: Compile with
-Wsystem-headers.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc:
Likewise.
* testsuite/30_threads/packaged_task/cons/dangling_ref.cc:
Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit e690b97761e18daccb4fff0151c97c1d0115b55f)

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

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

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

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