]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
10 months agos390: Fix AQ and AR constraints
Stefan Schulze Frielinghaus [Fri, 27 Sep 2024 10:45:42 +0000 (12:45 +0200)] 
s390: Fix AQ and AR constraints

Ensure for AQ and AR constraints that the resulting displacement after
adding any positive offset less than the size of the object being
referenced is still valid.

gcc/ChangeLog:

* config/s390/s390.cc (s390_mem_constraint): Check displacement
for AQ and AR constraints.

(cherry picked from commit 1a71ff3b89aadc7fa0af0bca269d74bb23c1a957)

10 months agoDaily bump.
GCC Administrator [Fri, 27 Sep 2024 00:20:45 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Thu, 26 Sep 2024 00:21:00 +0000 (00:21 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 25 Sep 2024 00:20:31 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Tue, 24 Sep 2024 00:20:06 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 23 Sep 2024 00:19:53 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 22 Sep 2024 00:20:46 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 21 Sep 2024 00:19:46 +0000 (00:19 +0000)] 
Daily bump.

10 months agoFortran: fix ICE in gfc_create_module_variable [PR100273]
Harald Anlauf [Thu, 5 Sep 2024 19:30:25 +0000 (21:30 +0200)] 
Fortran: fix ICE in gfc_create_module_variable [PR100273]

gcc/fortran/ChangeLog:

PR fortran/100273
* trans-decl.cc (gfc_create_module_variable): Handle module
variable also when it is needed for the result specification
of a contained function.

gcc/testsuite/ChangeLog:

PR fortran/100273
* gfortran.dg/pr100273.f90: New test.

(cherry picked from commit 1f462b5072a5e82c35921f7e3bdf3959c4a49dc9)

10 months agoDaily bump.
GCC Administrator [Fri, 20 Sep 2024 17:37:53 +0000 (17:37 +0000)] 
Daily bump.

10 months agoFix small thinko in IPA mod/ref pass
Eric Botcazou [Fri, 20 Sep 2024 10:32:13 +0000 (12:32 +0200)] 
Fix small thinko in IPA mod/ref pass

When a memory copy operation is analyzed by analyze_ssa_name, if both the
load and store are made through the same SSA name, the store is overlooked.

gcc/
* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Always
process both the load and the store of a memory copy operation.

gcc/testsuite/
* gcc.dg/ipa/modref-4.c: New test.

10 months agos390: Fix strict_low_part generation
Stefan Schulze Frielinghaus [Fri, 20 Sep 2024 12:08:32 +0000 (14:08 +0200)] 
s390: Fix strict_low_part generation

In s390_expand_insv(), if generating code for ICM et al. src is a MEM
and gen_lowpart might force src into a register such that we end up with
patterns which do not match anymore.  Use adjust_address() instead in
order to preserve a MEM.

Furthermore, it is not straight forward to enforce a subreg.  For
example, in case of a paradoxical subreg, gen_lowpart() may return a
register.  In order to compensate this, s390_gen_lowpart_subreg() emits
a reference to a pseudo which does not coincide with its definition
which is wrong.  Additionally, if dest is a paradoxical subreg, then do
not try to emit a strict_low_part since it could mean that dest was not
initialized even though this might be fixed up later by init-regs.

Splitter for insn *get_tp_64, *zero_extendhisi2_31,
*zero_extendqisi2_31, *zero_extendqihi2_31 are applied after reload.
Thus, operands[0] is a hard register and gen_lowpart (m, operands[0])
just returns the hard register for mode m which is fine to use as an
argument for strict_low_part, i.e., we do not need to enforce subregs
here since after reload subregs are supposed to be eliminated anyway.

This fixes gcc.dg/torture/pr111821.c.

gcc/ChangeLog:

* config/s390/s390-protos.h (s390_gen_lowpart_subreg): Remove.
* config/s390/s390.cc (s390_gen_lowpart_subreg): Remove.
(s390_expand_insv): Use adjust_address() and emit a
strict_low_part only in case of a natural subreg.
* config/s390/s390.md: Use gen_lowpart() instead of
s390_gen_lowpart_subreg().

(cherry picked from commit 9ebc9fbdddfe1ec85355b068354315a4da8e1ca0)

10 months agodoc: Add more alias option and reorder Intel CPU -march documentation
Haochen Jiang [Wed, 18 Sep 2024 03:20:15 +0000 (11:20 +0800)] 
doc: Add more alias option and reorder Intel CPU -march documentation

This patch is backported from GCC15 with some tweaks.

Since r15-3539, there are requests coming in to add other alias option
documentation. This patch will add all of them, including corei7, corei7-avx,
core-avx-i, core-avx2, atom and slm.

Also in the patch, I reordered that part of documentation, currently all
the CPUs/products are just all over the place. I regrouped them by
date-to-now products (since the very first CPU to latest Panther Lake), P-core
(since the clients become hybrid cores, starting from Sapphire Rapids) and
E-core (since Bonnell). In GCC14 and eariler GCC, Xeon Phi CPUs are still
there, I put them after E-core CPUs.

And in the patch, I refined the product names in documentation.

gcc/ChangeLog:

* doc/invoke.texi: Add corei7, corei7-avx, core-avx-i,
core-avx2, atom, and slm. Reorder the -march documentation by
splitting them into date-to-now products, P-core, E-core and
Xeon Phi. Refine the product names in documentation.

10 months agoDaily bump.
GCC Administrator [Thu, 19 Sep 2024 00:20:51 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 18 Sep 2024 00:19:22 +0000 (00:19 +0000)] 
Daily bump.

10 months agoc++: crash with anon VAR_DECL [PR116676]
Marek Polacek [Mon, 16 Sep 2024 20:42:38 +0000 (16:42 -0400)] 
c++: crash with anon VAR_DECL [PR116676]

r12-3495 added maybe_warn_about_constant_value which will crash if
it gets a nameless VAR_DECL, which is what happens in this PR.

We created this VAR_DECL in cp_parser_decomposition_declaration.

PR c++/116676

gcc/cp/ChangeLog:

* constexpr.cc (maybe_warn_about_constant_value): Check DECL_NAME.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-116676.C: New test.

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

10 months agoDaily bump.
GCC Administrator [Tue, 17 Sep 2024 00:18:27 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 16 Sep 2024 00:18:36 +0000 (00:18 +0000)] 
Daily bump.

10 months agox86-64: Don't use temp for argument in a TImode register
H.J. Lu [Fri, 6 Sep 2024 12:24:07 +0000 (05:24 -0700)] 
x86-64: Don't use temp for argument in a TImode register

Don't use temp for a PARALLEL BLKmode argument of an EXPR_LIST expression
in a TImode register.  Otherwise, the TImode variable will be put in
the GPR save area which guarantees only 8-byte alignment.

gcc/

PR target/116621
* config/i386/i386.cc (ix86_gimplify_va_arg): Don't use temp for
a PARALLEL BLKmode container of an EXPR_LIST expression in a
TImode register.

gcc/testsuite/

PR target/116621
* gcc.target/i386/pr116621.c: New test.

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

10 months agoDaily bump.
GCC Administrator [Sun, 15 Sep 2024 00:18:06 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 14 Sep 2024 00:18:08 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Fri, 13 Sep 2024 00:19:01 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Thu, 12 Sep 2024 00:18:11 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Wed, 11 Sep 2024 00:19:52 +0000 (00:19 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Tue, 10 Sep 2024 00:25:59 +0000 (00:25 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Mon, 9 Sep 2024 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sun, 8 Sep 2024 00:20:33 +0000 (00:20 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Sat, 7 Sep 2024 00:18:42 +0000 (00:18 +0000)] 
Daily bump.

10 months agoDaily bump.
GCC Administrator [Fri, 6 Sep 2024 00:19:57 +0000 (00:19 +0000)] 
Daily bump.

10 months agoipa: Don't disable function parameter analysis for fat LTO
H.J. Lu [Tue, 27 Aug 2024 20:11:39 +0000 (13:11 -0700)] 
ipa: Don't disable function parameter analysis for fat LTO

Update analyze_parms not to disable function parameter analysis for
-ffat-lto-objects.  Tested on x86-64, there are no differences in zstd
with "-O2 -flto=auto" -g "vs -O2 -flto=auto -g -ffat-lto-objects".

PR ipa/116410
* ipa-modref.cc (analyze_parms): Always analyze function parameter
for LTO.

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

10 months agoDaily bump.
GCC Administrator [Thu, 5 Sep 2024 00:20:00 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 4 Sep 2024 00:25:58 +0000 (00:25 +0000)] 
Daily bump.

11 months agoi386: Fix vfpclassph non-optimizied intrin
Haochen Jiang [Mon, 2 Sep 2024 07:00:22 +0000 (15:00 +0800)] 
i386: Fix vfpclassph non-optimizied intrin

The intrin for non-optimized got a typo in mask type, which will cause
the high bits of __mmask32 being unexpectedly zeroed.

The test does not fail under O0 with current 1b since the testcase is
wrong. We need to include avx512-mask-type.h after SIZE is defined, or
it will always be __mmask8. That problem also happened in AVX10.2 testcases.
I will write a seperate patch to fix that.

gcc/ChangeLog:

* config/i386/avx512fp16intrin.h
(_mm512_mask_fpclass_ph_mask): Correct mask type to __mmask32.
(_mm512_fpclass_ph_mask): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512fp16-vfpclassph-1c.c: New test.

11 months agoDaily bump.
GCC Administrator [Tue, 3 Sep 2024 00:23:54 +0000 (00:23 +0000)] 
Daily bump.

11 months agoCheck avx upper register for parallel.
liuhongt [Thu, 29 Aug 2024 03:39:20 +0000 (11:39 +0800)] 
Check avx upper register for parallel.

For function arguments/return, when it's BLK mode, it's put in a
parallel with an expr_list, and the expr_list contains the real mode
and registers.
Current ix86_check_avx_upper_register only checked for SSE_REG_P, and
failed to handle that. The patch extend the handle to each subrtx.

gcc/ChangeLog:

PR target/116512
* config/i386/i386.cc (ix86_check_avx_upper_register): Iterate
subrtx to scan for avx upper register.
(ix86_check_avx_upper_stores): Inline old
ix86_check_avx_upper_register.
(ix86_avx_u128_mode_needed): Ditto, and replace
FOR_EACH_SUBRTX with call to new
ix86_check_avx_upper_register.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit ab214ef734bfc3dcffcf79ff9e1dd651c2b40566)

11 months agoDaily bump.
GCC Administrator [Mon, 2 Sep 2024 00:20:58 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 1 Sep 2024 00:29:35 +0000 (00:29 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 31 Aug 2024 00:20:04 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 30 Aug 2024 00:24:32 +0000 (00:24 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 29 Aug 2024 00:21:13 +0000 (00:21 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 28 Aug 2024 00:21:21 +0000 (00:21 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Mon, 26 Aug 2024 00:20:27 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 25 Aug 2024 00:20:22 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 24 Aug 2024 00:19:20 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 23 Aug 2024 00:18:43 +0000 (00:18 +0000)] 
Daily bump.

11 months agoFix testcase failure.
liuhongt [Thu, 22 Aug 2024 06:31:40 +0000 (14:31 +0800)] 
Fix testcase failure.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pieces-memcpy-10.c: Use -mmove-max=256 and
-mstore-max=256.
* gcc.target/i386/pieces-memcpy-6.c: Ditto.
* gcc.target/i386/pieces-memset-38.c: Ditto.
* gcc.target/i386/pieces-memset-40.c: Ditto.
* gcc.target/i386/pieces-memset-41.c: Ditto.
* gcc.target/i386/pieces-memset-42.c: Ditto.
* gcc.target/i386/pieces-memset-43.c: Ditto.
* gcc.target/i386/pieces-strcpy-2.c: Ditto.

(cherry picked from commit ea9c508927ec032c6d67a24df59ffa429e4d3d95)

11 months agoAlign ix86_{move_max,store_max} with vectorizer.
liuhongt [Thu, 15 Aug 2024 04:54:07 +0000 (12:54 +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".

The patch fixes that.

gcc/ChangeLog:

* config/i386/i386-options.cc (ix86_option_override_internal):
set ix86_{move_max,store_max} to PVW_AVX256 when TARGET_AVX
instead of PVW_AVX128.

gcc/testsuite/ChangeLog:
* gcc.target/i386/pieces-memcpy-10.c: Add -mprefer-vector-width=128.
* gcc.target/i386/pieces-memcpy-6.c: Ditto.
* gcc.target/i386/pieces-memset-38.c: Ditto.
* gcc.target/i386/pieces-memset-40.c: Ditto.
* gcc.target/i386/pieces-memset-41.c: Ditto.
* gcc.target/i386/pieces-memset-42.c: Ditto.
* gcc.target/i386/pieces-memset-43.c: Ditto.
* gcc.target/i386/pieces-strcpy-2.c: Ditto.
* gcc.target/i386/pieces-memcpy-22.c: New test.
* gcc.target/i386/pieces-memset-51.c: New test.
* gcc.target/i386/pieces-strcpy-3.c: New test.

(cherry picked from commit aea374238cec1a1e53fb79575d2f998e16926999)

11 months agoDaily bump.
GCC Administrator [Thu, 22 Aug 2024 00:19:44 +0000 (00:19 +0000)] 
Daily bump.

11 months ago[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]
Alexandre Oliva [Wed, 26 Jun 2024 05:08:18 +0000 (02:08 -0300)] 
[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts by
clamping the shift counts below the bit width of the types (e.g. at 15
for 16-bit vector elements), but (uint16_t)32768 >> (uint16_t)16 is
well defined (because of promotion to 32-bit int) and must yield 0,
not 1 (as before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the vectorization we no longer performed
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization, and Christophe Lyon suggested a further
simplification.

Co-Authored-By: Richard Earnshaw <Richard.Earnshaw@arm.com>
for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

(cherry picked from commit 54d2339c9f87f702e02e571a5460e11c19e1c02f)

11 months agoDaily bump.
GCC Administrator [Wed, 21 Aug 2024 00:20:08 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Tue, 20 Aug 2024 00:19:54 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Mon, 19 Aug 2024 00:19:05 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 18 Aug 2024 00:18:49 +0000 (00:18 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 17 Aug 2024 00:18:53 +0000 (00:18 +0000)] 
Daily bump.

11 months agoaarch64: Fix bogus cnot optimisation [PR114603]
Richard Sandiford [Fri, 16 Aug 2024 14:37:50 +0000 (15:37 +0100)] 
aarch64: Fix bogus cnot optimisation [PR114603]

aarch64-sve.md had a pattern that combined:

cmpeq pb.T, pa/z, zc.T, #0
mov zd.T, pb/z, #1

into:

cnot zd.T, pa/m, zc.T

But this is only valid if pa.T is a ptrue.  In other cases, the
original would set inactive elements of zd.T to 0, whereas the
combined form would copy elements from zc.T.

gcc/
PR target/114603
* config/aarch64/aarch64-sve.md (@aarch64_pred_cnot<mode>): Replace
with...
(@aarch64_ptrue_cnot<mode>): ...this, requiring operand 1 to be
a ptrue.
(*cnot<mode>): Require operand 1 to be a ptrue.
* config/aarch64/aarch64-sve-builtins-base.cc (svcnot_impl::expand):
Use aarch64_ptrue_cnot<mode> for _x operations that are predicated
with a ptrue.  Represent other _x operations as fully-defined _m
operations.

gcc/testsuite/
PR target/114603
* gcc.target/aarch64/sve/acle/general/cnot_1.c: New test.

(cherry picked from commit 67cbb1c638d6ab3a9cb77e674541e2b291fb67df)

11 months agoaarch64: Fix expansion of svsudot [PR114607]
Richard Sandiford [Fri, 16 Aug 2024 14:37:50 +0000 (15:37 +0100)] 
aarch64: Fix expansion of svsudot [PR114607]

Not sure how this happend, but: svsudot is supposed to be expanded
as USDOT with the operands swapped.  However, a thinko in the
expansion of svsudot meant that the arguments weren't in fact
swapped; the attempted swap was just a no-op.  And the testcases
blithely accepted that.

gcc/
PR target/114607
* config/aarch64/aarch64-sve-builtins-base.cc
(svusdot_impl::expand): Fix botched attempt to swap the operands
for svsudot.

gcc/testsuite/
PR target/114607
* gcc.target/aarch64/sve/acle/asm/sudot_s32.c: New test.

(cherry picked from commit 2c1c2485a4b1aca746ac693041e51ea6da5c64ca)

11 months agoDaily bump.
GCC Administrator [Fri, 16 Aug 2024 00:19:08 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 15 Aug 2024 00:22:33 +0000 (00:22 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 14 Aug 2024 00:19:54 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Tue, 13 Aug 2024 00:20:00 +0000 (00:20 +0000)] 
Daily bump.

11 months agoRefine constraint "Bk" to define_special_memory_constraint.
liuhongt [Wed, 24 Jul 2024 03:29:23 +0000 (11:29 +0800)] 
Refine constraint "Bk" to define_special_memory_constraint.

For below pattern, RA may still allocate r162 as v/k register, try to
reload for address with leaq __libc_tsd_CTYPE_B@gottpoff(%rip), %rsi
which result a linker error.

(set (reg:DI 162)
     (mem/u/c:DI
       (const:DI (unspec:DI
 [(symbol_ref:DI ("a") [flags 0x60]  <var_decl 0x7f621f6e1c60 a>)]
 UNSPEC_GOTNTPOFF))

Quote from H.J for why linker issue an error.
>What do these do:
>
>        leaq    __libc_tsd_CTYPE_B@gottpoff(%rip), %rax
>        vmovq   (%rax), %xmm0
>
>From x86-64 TLS psABI:
>
>The assembler generates for the x@gottpoff(%rip) expressions a R X86
>64 GOTTPOFF relocation for the symbol x which requests the linker to
>generate a GOT entry with a R X86 64 TPOFF64 relocation. The offset of
>the GOT entry relative to the end of the instruction is then used in
>the instruction. The R X86 64 TPOFF64 relocation is pro- cessed at
>program startup time by the dynamic linker by looking up the symbol x
>in the modules loaded at that point. The offset is written in the GOT
>entry and later loaded by the addq instruction.
>
>The above code sequence looks wrong to me.

gcc/ChangeLog:

PR target/116043
* config/i386/constraints.md (Bk): Refine to
define_special_memory_constraint.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit bc1fda00d5f20e2f3e77a50b2822562b6e0040b2)

11 months agoDaily bump.
GCC Administrator [Mon, 12 Aug 2024 00:20:04 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sun, 11 Aug 2024 00:19:37 +0000 (00:19 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Sat, 10 Aug 2024 00:20:01 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Fri, 9 Aug 2024 00:20:31 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Thu, 8 Aug 2024 00:20:19 +0000 (00:20 +0000)] 
Daily bump.

11 months agoDaily bump.
GCC Administrator [Wed, 7 Aug 2024 00:18:20 +0000 (00:18 +0000)] 
Daily bump.

11 months agohppa: Fix (plus (plus (mult (a) (mem_shadd_constant)) (b)) (c)) optimization
John David Anglin [Tue, 6 Aug 2024 17:40:26 +0000 (13:40 -0400)] 
hppa: Fix (plus (plus (mult (a) (mem_shadd_constant)) (b)) (c)) optimization

The constant C must be an integral multiple of the shift value in
the above optimization.  Non integral values can occur evaluating
IMAGPART_EXPR when the shadd constant is 8 and we have SFmode.

2024-08-06  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR target/113384
* config/pa/pa.cc (hppa_legitimize_address): Add check to
ensure constant is an integral multiple of shift the value.

11 months agosh: Don't call make_insn_raw in sh_recog_treg_set_expr [PR116189]
Andrew Pinski [Sat, 3 Aug 2024 16:30:57 +0000 (09:30 -0700)] 
sh: Don't call make_insn_raw in sh_recog_treg_set_expr [PR116189]

This was an interesting compare debug failure to debug. The first symptom
was in gcse which would produce different order of creating psedu-registers. This
was caused by a different order of a hashtable walk, due to the hash table having different
number of entries. Which in turn was due to the number of max insn being different between
the 2 runs. The place max insn uid comes from was in sh_recog_treg_set_expr which is called
via rtx_costs and fwprop would cause rtx_costs in some cases for debug insn related stuff.

Build and tested for sh4-linux-gnu.

PR target/116189

gcc/ChangeLog:

* config/sh/sh.cc (sh_recog_treg_set_expr): Don't call make_insn_raw,
make the insn with a fake uid.

gcc/testsuite/ChangeLog:

* c-c++-common/torture/pr116189-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
(cherry picked from commit 0355c943b9e954e8f59068971d934f1b91ecb729)

11 months agoDaily bump.
GCC Administrator [Tue, 6 Aug 2024 00:18:50 +0000 (00:18 +0000)] 
Daily bump.

11 months agolibgomp: Remove bogus warnings from privatized-ref-2.f90.
Paul Thomas [Fri, 19 Jul 2024 15:58:33 +0000 (16:58 +0100)] 
libgomp: Remove bogus warnings from privatized-ref-2.f90.

2024-07-19  Paul Thomas  <pault@gcc.gnu.org>

libgomp/ChangeLog

* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Cut
dg-note about 'a' and remove bogus warnings about its array
descriptor components being used uninitialized.

(cherry picked from commit 8d6994f33a98a168151a57a3d21395b19196cd9d)

11 months agoFortran: Suppress bogus used uninitialized warnings [PR108889].
Paul Thomas [Thu, 18 Jul 2024 07:51:35 +0000 (08:51 +0100)] 
Fortran: Suppress bogus used uninitialized warnings [PR108889].

2024-07-18  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/108889
* gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
* trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
after allocation if not a component reference.
(gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
not set, not a component ref and not allocated, set the array
bounds and offset to give zero length in all dimensions. Then
set allocated_in_scope.

gcc/testsuite/
PR fortran/108889
* gfortran.dg/pr108889.f90: New test.

(cherry picked from commit c3aa339ea50f050caf7ed2e497f5499ec2d7b9cc)

12 months agoDaily bump.
GCC Administrator [Mon, 5 Aug 2024 00:18:15 +0000 (00:18 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Sun, 4 Aug 2024 00:18:24 +0000 (00:18 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Sat, 3 Aug 2024 00:19:48 +0000 (00:19 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Fri, 2 Aug 2024 00:20:36 +0000 (00:20 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Thu, 1 Aug 2024 00:21:27 +0000 (00:21 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Wed, 31 Jul 2024 00:20:45 +0000 (00:20 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Tue, 30 Jul 2024 00:20:00 +0000 (00:20 +0000)] 
Daily bump.

12 months agoi386: Use _mm_setzero_ps/d instead of _mm_avx512_setzero_ps/d for GCC13/12
Haochen Jiang [Mon, 29 Jul 2024 06:10:49 +0000 (14:10 +0800)] 
i386: Use _mm_setzero_ps/d instead of _mm_avx512_setzero_ps/d for GCC13/12

In GCC13/12, there is no _mm_avx512_setzero_ps/d since it is introduced
in GCC14.

gcc/ChangeLog:

* config/i386/avx512dqintrin.h (_mm_reduce_round_sd): Use
_mm_setzero_pd instead of _mm_avx512_setzero_pd.
(_mm_reduce_round_ss): Use _mm_setzero_ps instead of
_mm_avx512_setzero_ps.

12 months agoi386: Fix AVX512 intrin macro typo
Haochen Jiang [Thu, 25 Jul 2024 08:12:20 +0000 (16:12 +0800)] 
i386: Fix AVX512 intrin macro typo

There are several typo in AVX512 intrins macro define. Correct them to solve
errors when compiled with -O0.

gcc/ChangeLog:

* config/i386/avx512dqintrin.h
(_mm_mask_fpclass_ss_mask): Correct operand order.
(_mm_mask_fpclass_sd_mask): Ditto.
(_mm256_maskz_reduce_round_ss): Use __builtin_ia32_reducess_mask_round
instead of __builtin_ia32_reducesd_mask_round.
(_mm_reduce_round_sd): Use -1 as mask since it is non-mask.
(_mm_reduce_round_ss): Ditto.
* config/i386/avx512vlbwintrin.h
(_mm256_mask_alignr_epi8): Correct operand usage.
(_mm_mask_alignr_epi8): Ditto.
* config/i386/avx512vlintrin.h (_mm_mask_alignr_epi64): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512bw-vpalignr-1b.c: New test.
* gcc.target/i386/avx512dq-vfpclasssd-1b.c: Ditto.
* gcc.target/i386/avx512dq-vfpclassss-1b.c: Ditto.
* gcc.target/i386/avx512dq-vreducesd-1b.c: Ditto.
* gcc.target/i386/avx512dq-vreducess-1b.c: Ditto.
* gcc.target/i386/avx512vl-valignq-1b.c: Ditto.

12 months agoDaily bump.
GCC Administrator [Mon, 29 Jul 2024 00:19:56 +0000 (00:19 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Sun, 28 Jul 2024 00:20:21 +0000 (00:20 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Sat, 27 Jul 2024 00:19:32 +0000 (00:19 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Fri, 26 Jul 2024 00:19:49 +0000 (00:19 +0000)] 
Daily bump.

12 months agoDaily bump.
GCC Administrator [Thu, 25 Jul 2024 00:21:26 +0000 (00:21 +0000)] 
Daily bump.

12 months agors6000: Catch unsupported ABI errors when using -mrop-protect [PR114759,PR115988]
Peter Bergner [Thu, 18 Jul 2024 23:01:46 +0000 (18:01 -0500)] 
rs6000: Catch unsupported ABI errors when using -mrop-protect [PR114759,PR115988]

2024-07-18  Peter Bergner  <bergner@linux.ibm.com>

gcc/testsuite/
PR target/114759
PR target/115988
* gcc.target/powerpc/pr114759-3.c: Catch unsupported ABI errors.

(cherry picked from commit b2f47a5c1d5204131660ea0372a08e692df8844e)

12 months agors6000: Error on CPUs and ABIs that don't support the ROP protection insns [PR114759]
Peter Bergner [Mon, 15 Jul 2024 21:57:32 +0000 (16:57 -0500)] 
rs6000: Error on CPUs and ABIs that don't support the ROP protection insns [PR114759]

We currently silently ignore the -mrop-protect option for old CPUs we don't
support with the ROP hash insns, but we throw an error for unsupported ABIs.
This patch treats unsupported CPUs and ABIs similarly by throwing an error
both both.  This matches clang behavior and allows us to simplify our tests
in the code that generates our prologue and epilogue code.

2024-06-26  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/114759
* config/rs6000/rs6000.cc (rs6000_option_override_internal): Disallow
CPUs and ABIs that do no support the ROP protection insns.
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): Remove now
unneeded tests.
(rs6000_emit_prologue): Likewise.
Remove unneeded gcc_assert.
(rs6000_emit_epilogue): Likewise.
* config/rs6000/rs6000.md: Likewise.

gcc/testsuite/
PR target/114759
* gcc.target/powerpc/pr114759-3.c: New test.

(cherry picked from commit 6f2bab9b5d1ce1914c748b7dcd8638dafaa98df7)

12 months agors6000: ROP - Emit hashst and hashchk insns on Power8 and later [PR114759]
Peter Bergner [Wed, 19 Jun 2024 21:07:29 +0000 (16:07 -0500)] 
rs6000: ROP - Emit hashst and hashchk insns on Power8 and later [PR114759]

We currently only emit the ROP-protect hash* insns for Power10, where the
insns were added to the architecture.  We want to emit them for earlier
cpus (where they operate as NOPs), so that if those older binaries are
ever executed on a Power10, then they'll be protected from ROP attacks.
Binutils accepts hashst and hashchk back to Power8, so change GCC to emit
them for Power8 and later.  This matches clang's behavior.

2024-06-19  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/114759
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): Use TARGET_POWER8.
(rs6000_emit_prologue): Likewise.
* config/rs6000/rs6000.md (hashchk): Likewise.
(hashst): Likewise.
Fix whitespace.

gcc/testsuite/
PR target/114759
* gcc.target/powerpc/pr114759-2.c: New test.
* lib/target-supports.exp (rop_ok): Use
check_effective_target_has_arch_pwr8.

(cherry picked from commit a05c3d23d1e1c8d2971b123804fc7a61a3561adb)

12 months agors6000: Compute rop_hash_save_offset for non-Altivec compiles [PR115389]
Peter Bergner [Fri, 14 Jun 2024 19:36:20 +0000 (14:36 -0500)] 
rs6000: Compute rop_hash_save_offset for non-Altivec compiles [PR115389]

We currently only compute the offset for the ROP hash save location in
the stack frame for Altivec compiles.  For non-Altivec compiles when we
emit ROP mitigation instructions, we use a default offset of zero which
corresponds to the backchain save location which will get clobbered on
any call.  The fix is to compute the ROP hash save location for all
compiles.

2024-06-14  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/115389
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): Compute
rop_hash_save_offset for non-Altivec compiles.

gcc/testsuite
PR target/115389
* gcc.target/powerpc/pr115389.c: New test.

(cherry picked from commit c70eea0dba5f223d49c80cfb3e80e87b74330aac)

12 months agors6000: Update ELFv2 stack frame comment showing the correct ROP save location
Peter Bergner [Fri, 7 Jun 2024 21:03:08 +0000 (16:03 -0500)] 
rs6000: Update ELFv2 stack frame comment showing the correct ROP save location

The ELFv2 stack frame layout comment in rs6000-logue.cc shows the ROP
hash save slot in the wrong location.  Update the comment to show the
correct ROP hash save location in the frame.

2024-06-07  Peter Bergner  <bergner@linux.ibm.com>

gcc/
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): Update comment.

(cherry picked from commit e91cf26a954a5c1bf431e36f3a1e69f94e9fa4fe)

12 months agoDaily bump.
GCC Administrator [Wed, 24 Jul 2024 00:20:56 +0000 (00:20 +0000)] 
Daily bump.

12 months agoFixup unaligned load/store cost for znver4
Richard Biener [Mon, 15 Jul 2024 11:01:24 +0000 (13:01 +0200)] 
Fixup unaligned load/store cost for znver4

Currently unaligned YMM and ZMM load and store costs are cheaper than
aligned which causes the vectorizer to purposely mis-align accesses
by adding an alignment prologue.  It looks like the unaligned costs
were simply left untouched from znver3 where they equate the aligned
costs when tweaking aligned costs for znver4.  The following makes
the unaligned costs equal to the aligned costs.

This avoids the miscompile seen in PR115843 but it's of course not
a real fix for the issue uncovered there.  But it makes it qualify
as a regression fix.

PR tree-optimization/115843
* config/i386/x86-tune-costs.h (znver4_cost): Update unaligned
load and store cost from the aligned costs.

(cherry picked from commit 1e3aa9c9278db69d4bdb661a750a7268789188d6)

12 months ago[powerpc] [testsuite] reorder dg directives [PR106069]
Alexandre Oliva [Tue, 23 Jul 2024 05:19:55 +0000 (02:19 -0300)] 
[powerpc] [testsuite] reorder dg directives [PR106069]

The dg-do directive appears after dg-require-effective-target in
g++.target/powerpc/pr106069.C.  That doesn't work the way that was
presumably intended.  Both of these directives set dg-do-what, but
dg-do does so fully and unconditionally, overriding any decisions
recorded there by earlier directives.  Reorder the directives more
canonically, so that both take effect.

for  gcc/testsuite/ChangeLog

PR target/106069
* g++.target/powerpc/pr106069.C: Reorder dg directives.

(cherry picked from commit ad65caa332bc7600caff6b9b5b29175b40d91e67)

12 months agoDaily bump.
GCC Administrator [Tue, 23 Jul 2024 00:20:10 +0000 (00:20 +0000)] 
Daily bump.

12 months ago[PR115565] cse: Don't use a valid regno for non-register in comparison_qty
Maciej W. Rozycki [Sat, 29 Jun 2024 22:26:55 +0000 (23:26 +0100)] 
[PR115565] cse: Don't use a valid regno for non-register in comparison_qty

Use INT_MIN rather than -1 in `comparison_qty' where a comparison is not
with a register, because the value of -1 is actually a valid reference
to register 0 in the case where it has not been assigned a quantity.

Using -1 makes `REG_QTY (REGNO (folded_arg1)) == ent->comparison_qty'
comparison in `fold_rtx' to incorrectly trigger in rare circumstances
and return true for a memory reference, making CSE consider a comparison
operation to evaluate to a constant expression and consequently make the
resulting code incorrectly execute or fail to execute conditional
blocks.

This has caused a miscompilation of rwlock.c from LinuxThreads for the
`alpha-linux-gnu' target, where `rwlock->__rw_writer != thread_self ()'
expression (where `thread_self' returns the thread pointer via a PALcode
call) has been decided to be always true (with `ent->comparison_qty'
using -1 for a reference to to `rwlock->__rw_writer', while register 0
holding the thread pointer retrieved by `thread_self') and code for the
false case has been optimized away where it mustn't have, causing
program lockups.

The issue has been observed as a regression from commit 08a692679fb8
("Undefined cse.c behaviour causes 3.4 regression on HPUX"),
<https://gcc.gnu.org/ml/gcc-patches/2004-10/msg02027.html>, and up to
commit 932ad4d9b550 ("Make CSE path following use the CFG"),
<https://gcc.gnu.org/ml/gcc-patches/2006-12/msg00431.html>, where CSE
has been restructured sufficiently for the issue not to trigger with the
original reproducer anymore.  However the original bug remains and can
trigger, because `comparison_qty' will still be assigned -1 for a memory
reference and the `reg_qty' member of a `cse_reg_info_table' entry will
still be assigned -1 for register 0 where the entry has not been
assigned a quantity, e.g. at initialization.

Use INT_MIN then as noted above, so that the value remains negative, for
consistency with the REGNO_QTY_VALID_P macro (even though not used on
`comparison_qty'), and then so that it should not ever match a valid
negated register number, fixing the regression with commit 08a692679fb8.

gcc/
PR rtl-optimization/115565
* cse.cc (record_jump_cond): Use INT_MIN rather than -1 for
`comparison_qty' if !REG_P.

(cherry picked from commit 69bc5fb97dc3fada81869e00fa65d39f7def6acf)

12 months agoDaily bump.
GCC Administrator [Mon, 22 Jul 2024 00:20:00 +0000 (00:20 +0000)] 
Daily bump.

12 months agoFortran: character array constructor with >= 4 constant elements [PR103115]
Harald Anlauf [Thu, 18 Jul 2024 19:15:48 +0000 (21:15 +0200)] 
Fortran: character array constructor with >= 4 constant elements [PR103115]

gcc/fortran/ChangeLog:

PR fortran/103115
* trans-array.cc (gfc_trans_array_constructor_value): If the first
element of an array constructor is deferred-length character and
therefore does not have an element size known at compile time, do
not try to collect subsequent constant elements into a constructor
for optimization.

gcc/testsuite/ChangeLog:

PR fortran/103115
* gfortran.dg/string_array_constructor_4.f90: New test.

(cherry picked from commit c93be1606ecf8e0f65b96b67aa023fb456ceb3a3)

12 months agoDaily bump.
GCC Administrator [Sun, 21 Jul 2024 00:19:41 +0000 (00:19 +0000)] 
Daily bump.

12 months agoAvoid undefined behaviour in build_option_suggestions
Siddhesh Poyarekar [Fri, 19 Jul 2024 16:44:32 +0000 (12:44 -0400)] 
Avoid undefined behaviour in build_option_suggestions

The inner loop in build_option_suggestions uses OPTION to take the
address of OPTB and use it across iterations, which is undefined
behaviour since OPTB is defined within the loop.  Pull it outside the
loop to make this defined.

gcc/ChangeLog:

* opt-suggestions.cc
(option_proposer::build_option_suggestions): Pull OPTB
definition out of the innermost loop.

(cherry picked from commit e0d997e913f811ecf4b3e10891e6a4aab5b38a31)