]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
7 months agoDaily bump.
GCC Administrator [Mon, 9 Dec 2024 00:19:24 +0000 (00:19 +0000)] 
Daily bump.

7 months agoDaily bump.
GCC Administrator [Sun, 8 Dec 2024 00:19:57 +0000 (00:19 +0000)] 
Daily bump.

7 months agoDaily bump.
GCC Administrator [Sat, 7 Dec 2024 00:20:54 +0000 (00:20 +0000)] 
Daily bump.

7 months agoDaily bump.
GCC Administrator [Fri, 6 Dec 2024 00:20:44 +0000 (00:20 +0000)] 
Daily bump.

8 months agoAVR: target/64242 - Copy FP to a local reg in nonlocal_goto.
Georg-Johann Lay [Wed, 4 Dec 2024 19:56:50 +0000 (20:56 +0100)] 
AVR: target/64242 - Copy FP to a local reg in nonlocal_goto.

In nonlocal_goto sets, change hard_frame_pointer_rtx only after
emit_stack_restore() restored SP.  This is needed because SP
my be stored in some frame location.

gcc/
PR target/64242
* config/avr/avr.md (nonlocal_goto): Don't restore
hard_frame_pointer_rtx directly, but copy it to local
register, and only set hard_frame_pointer_rtx from it
after emit_stack_restore().

(cherry picked from commit f7b5527d1b48b33d8ab633c1e9dcb9883667492a)

8 months agoc++: Don't reject pointer to virtual method during constant evaluation [PR117615]
Simon Martin [Tue, 3 Dec 2024 13:30:43 +0000 (14:30 +0100)] 
c++: Don't reject pointer to virtual method during constant evaluation [PR117615]

We currently reject the following valid code:

=== cut here ===
struct Base {
    virtual void doit (int v) const {}
};
struct Derived : Base {
    void doit (int v) const {}
};
using fn_t = void (Base::*)(int) const;
struct Helper {
    fn_t mFn;
    constexpr Helper (auto && fn) : mFn(static_cast<fn_t>(fn)) {}
};
void foo () {
    constexpr Helper h (&Derived::doit);
}
=== cut here ===

The problem is that since r6-4014-gdcdbc004d531b4, &Derived::doit is
represented with an expression with type pointer to method and using an
INTEGER_CST (here 1), and that cxx_eval_constant_expression rejects any
such expression with a non-null INTEGER_CST.

This patch uses the same strategy as r12-4491-gf45610a45236e9 (fix for
PR c++/102786), and simply lets such expressions go through.

PR c++/117615

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_constant_expression): Don't reject
INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/constexpr-virtual22.C: New test.

(cherry picked from commit 72a2380a306a1c3883cb7e4f99253522bc265af0)

8 months agoDaily bump.
GCC Administrator [Thu, 5 Dec 2024 00:22:28 +0000 (00:22 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Wed, 4 Dec 2024 00:23:59 +0000 (00:23 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Tue, 3 Dec 2024 00:22:55 +0000 (00:22 +0000)] 
Daily bump.

8 months agoarm, mve: Adding missing Runtime Library Exception to header files
Andre Vieira [Mon, 2 Dec 2024 13:35:03 +0000 (13:35 +0000)] 
arm, mve: Adding missing Runtime Library Exception to header files

Add missing Runtime Library Exception to mve header files to bring them into
line with other similar headers. Not adding it in the first place was an
oversight.

gcc/ChangeLog:

* config/arm/arm_mve.h: Add Runtime Library Exception.
* config/arm/arm_mve_types.h: Likewise.

(cherry picked from commit cde7ce0628f66a5d03cc97c70d4695e6f2acd4db)

8 months agoDaily bump.
GCC Administrator [Mon, 2 Dec 2024 00:21:00 +0000 (00:21 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Sun, 1 Dec 2024 00:20:38 +0000 (00:20 +0000)] 
Daily bump.

8 months agoFortran: Fix failing character pointer fcn assignment [PR105054]
Paul Thomas [Wed, 13 Nov 2024 08:57:55 +0000 (08:57 +0000)] 
Fortran: Fix failing character pointer fcn assignment [PR105054]

2024-11-14  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/105054
* resolve.cc (get_temp_from_expr): If the pointer function has
a deferred character length, generate a new deferred charlen
for the temporary.

gcc/testsuite/
PR fortran/105054
* gfortran.dg/ptr_func_assign_6.f08: New test.

(cherry picked from commit f530a8c61383b174a476b64f46d56adeedf49dc4)

8 months agoDaily bump.
GCC Administrator [Sat, 30 Nov 2024 00:22:00 +0000 (00:22 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Fri, 29 Nov 2024 00:21:42 +0000 (00:21 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Thu, 28 Nov 2024 00:22:14 +0000 (00:22 +0000)] 
Daily bump.

8 months agotree-sra: Avoid SRAing arguments to a function returning_twice (PR 117142)
Martin Jambor [Fri, 15 Nov 2024 13:37:06 +0000 (14:37 +0100)] 
tree-sra: Avoid SRAing arguments to a function returning_twice (PR 117142)

This is a manual bacport of commit
29d8f1f0b7ad3c69b3bdb130325300d5f73aa784 which must be done slightly
elsewhere for gcc 13 and 12 because function
build_access_from_call_arg was added only in gcc 14.

But the gist of the patch is the same.  The commit message of the
original fix says:

PR 117142 shows that the current SRA probably never worked reliably
with arguments passed to a function returning twice, because it then
creates statements before the call which however needs to be at the
beginning of a basic block.

While it should be possible to make at least the case of passing
arguments by value work with SRA (the statements would need to be put
just on the non-abnormal edges leading to the BB), this would mean
large surgery of function sra_modify_expr and I guess the time would
better be spent re-organizing the whole pass.

gcc/ChangeLog:

2024-11-14  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/117142
* tree-sra.cc (scan_function): Disqualify any candidate passed to
a function returning twice.

gcc/testsuite/ChangeLog:

2024-11-14  Martin Jambor  <mjambor@suse.cz>

* gcc.dg/tree-ssa/pr117142.c: New test.

(cherry picked from commit 6244de432a5ba9807c6f0065e70a8025af7b1bd6)

8 months agoFortran: Partial reversion of r15-5083 [PR117763]
Paul Thomas [Tue, 26 Nov 2024 08:58:21 +0000 (08:58 +0000)] 
Fortran: Partial reversion of r15-5083 [PR117763]

2024-11-26  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/117763
* trans-array.cc (gfc_get_array_span): Guard against derefences
of 'expr'. Clean up some typos. Use 'gfc_get_vptr_from_expr'
for clarity and apply a functional reversion of last section
that deals with class dummies.

gcc/testsuite/
PR fortran/117763
* gfortran.dg/pr117763.f90: New test.

(cherry picked from commit 8278d9551df610179fca114808a7e6e62bab3d82)

8 months agoDaily bump.
GCC Administrator [Wed, 27 Nov 2024 00:21:35 +0000 (00:21 +0000)] 
Daily bump.

8 months agognat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]
Arsen Arsenović [Thu, 15 Aug 2024 17:17:41 +0000 (19:17 +0200)] 
gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

gcc/ada/ChangeLog:

PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.

(cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302)

8 months agoFix uninitialized operands[2] in vec_unpacks_hi_v4sf.
liuhongt [Fri, 22 Nov 2024 07:57:38 +0000 (23:57 -0800)] 
Fix uninitialized operands[2] in vec_unpacks_hi_v4sf.

It could cause weired spill in RA when register pressure is high.

gcc/ChangeLog:

PR target/117562
* config/i386/sse.md (vec_unpacks_hi_v4sf): Initialize
operands[2] with CONST0_RTX.

(cherry picked from commit ba4cf2e296d8d5950c3d356fa6b6efcad00d0189)

8 months agoDaily bump.
GCC Administrator [Tue, 26 Nov 2024 00:20:05 +0000 (00:20 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Mon, 25 Nov 2024 00:20:04 +0000 (00:20 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Sun, 24 Nov 2024 00:21:09 +0000 (00:21 +0000)] 
Daily bump.

8 months agoFortran: Fix elemental array refs in SELECT TYPE [PR109345]
Paul Thomas [Mon, 11 Nov 2024 12:21:57 +0000 (12:21 +0000)] 
Fortran: Fix elemental array refs in SELECT TYPE [PR109345]

2024-11-10  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/109345
* trans-array.cc (gfc_get_array_span): Unlimited polymorphic
expressions are now treated separately since the span need not
be the same as the element size.

gcc/testsuite/
PR fortran/109345
* gfortran.dg/character_workout_1.f90: Cut trailing whitespace.
* gfortran.dg/pr109345.f90: New test.

(cherry picked from commit e22d80d4f0f8d33f538c1a4bad07b2c819a6d55c)

8 months agoAVR: target/117744 - Fix asm for partial clobber of address reg,
Georg-Johann Lay [Sat, 23 Nov 2024 11:51:32 +0000 (12:51 +0100)] 
AVR: target/117744 - Fix asm for partial clobber of address reg,

gcc/
PR target/117744
* config/avr/avr.cc (out_movqi_r_mr): Fix code when a load
only partially clobbers an address register due to
changing the address register temporally to accommodate for
faked addressing modes.

(cherry picked from commit ee8e6784876aa050d2e01f54d1da4acf758b635a)

8 months agoDaily bump.
GCC Administrator [Sat, 23 Nov 2024 00:24:30 +0000 (00:24 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Fri, 22 Nov 2024 00:22:04 +0000 (00:22 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Thu, 21 Nov 2024 00:22:28 +0000 (00:22 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Wed, 20 Nov 2024 00:21:13 +0000 (00:21 +0000)] 
Daily bump.

8 months agoi386: Enable *rsqrtsf2_sse without TARGET_SSE_MATH [PR117357]
Uros Bizjak [Mon, 18 Nov 2024 21:38:46 +0000 (22:38 +0100)] 
i386: Enable *rsqrtsf2_sse without TARGET_SSE_MATH [PR117357]

__builtin_ia32_rsqrtsf2 expander generates UNSPEC_RSQRT insn pattern
also when TARGET_SSE_MATH is not set.  Enable *rsqrtsf2_sse without
TARGET_SSE_MATH to avoid ICE with unrecognizable insn.

PR target/117357

gcc/ChangeLog:

* config/i386/i386.md (*rsqrtsf2_sse):
Also enable for !TARGET_SSE_MATH.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 344356f781ddb7bf0abb11edf9bdd13f6802dea8)

8 months agoDaily bump.
GCC Administrator [Tue, 19 Nov 2024 00:20:33 +0000 (00:20 +0000)] 
Daily bump.

8 months agoAVR: target/117659 - Fix wrong code for u24 << 16.
Georg-Johann Lay [Mon, 18 Nov 2024 17:12:38 +0000 (18:12 +0100)] 
AVR: target/117659 - Fix wrong code for u24 << 16.

gcc/
PR target/117659
* config/avr/avr.cc (avr_out_ashlpsi3) [case 16]: Use %A1 as
input (instead of bogus %A0).

(cherry picked from commit bba27015f2815a8fa6fae46a29a70644e868341c)

8 months agoDaily bump.
GCC Administrator [Mon, 18 Nov 2024 00:21:34 +0000 (00:21 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Sun, 17 Nov 2024 00:24:56 +0000 (00:24 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Sat, 16 Nov 2024 00:20:38 +0000 (00:20 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Fri, 15 Nov 2024 00:20:23 +0000 (00:20 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Thu, 14 Nov 2024 17:21:45 +0000 (17:21 +0000)] 
Daily bump.

8 months agohppa: Remove inner `fix:SF/DF` from fixed-point patterns
John David Anglin [Wed, 13 Nov 2024 14:40:42 +0000 (09:40 -0500)] 
hppa: Remove inner `fix:SF/DF` from fixed-point patterns

2024-11-13  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR target/117525
* config/pa/pa.md (fix_truncsfsi2): Remove inner `fix:SF`.
(fix_truncdfsi2, fix_truncsfdi2, fix_truncdfdi2,
fixuns_truncsfsi2, fixuns_truncdfsi2, fixuns_truncsfdi2,
fixuns_truncdfdi2): Likewise.

8 months agoi386: Zero extend 32-bit address to 64-bit with option -mx32 -maddress-mode=long...
Hu, Lin1 [Wed, 6 Nov 2024 07:42:13 +0000 (15:42 +0800)] 
i386: Zero extend 32-bit address to 64-bit with option -mx32 -maddress-mode=long. [PR 117418]

-maddress-mode=long let Pmode = DI_mode, so zero extend 32-bit address to
64-bit and uses a 64-bit register as a pointer for avoid raise an ICE.

gcc/ChangeLog:

PR target/117418
* config/i386/i386-expand.cc (ix86_expand_builtin): Convert
pointer's mode according to Pmode.

gcc/testsuite/ChangeLog:

PR target/117418
* gcc.target/i386/pr117418-1.c: New test.

(cherry picked from commit 2272cd2508f1854c880082f792de15e76ec09a99)

8 months agoDaily bump.
GCC Administrator [Wed, 13 Nov 2024 00:20:50 +0000 (00:20 +0000)] 
Daily bump.

8 months agohppa: Fix decrement_and_branch_until_zero constraint
John David Anglin [Tue, 12 Nov 2024 19:26:08 +0000 (14:26 -0500)] 
hppa: Fix decrement_and_branch_until_zero constraint

The third alternative for argument 4 needs to be an early clobber
constraint.  Noticed testing LRA.

2024-11-12  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

* config/pa/pa.md (decrement_and_branch_until_zero): Fix
constraint.

8 months agoDaily bump.
GCC Administrator [Tue, 12 Nov 2024 00:21:19 +0000 (00:21 +0000)] 
Daily bump.

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

8 months agoDaily bump.
GCC Administrator [Sun, 10 Nov 2024 00:19:35 +0000 (00:19 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Sat, 9 Nov 2024 16:05:14 +0000 (16:05 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Thu, 7 Nov 2024 00:20:45 +0000 (00:20 +0000)] 
Daily bump.

8 months agoDaily bump.
GCC Administrator [Wed, 6 Nov 2024 00:21:21 +0000 (00:21 +0000)] 
Daily bump.

8 months agoc++: Defer -fstrong-eval-order processing to template instantiation time [PR117158]
Simon Martin [Tue, 5 Nov 2024 09:07:42 +0000 (10:07 +0100)] 
c++: Defer -fstrong-eval-order processing to template instantiation time [PR117158]

Since r10-3793-g1a37b6d9a7e57c, we ICE upon the following valid code
with -std=c++17 and above

=== cut here ===
struct Base {
  unsigned int *intarray;
};
template <typename T> struct Sub : public Base {
  bool Get(int i) {
    return (Base::intarray[++i] == 0);
  }
};
=== cut here ===

The problem is that from c++17 on, we use -fstrong-eval-order and need
to wrap the array access expression into a SAVE_EXPR. We do so at
template declaration time, and end up calling contains_placeholder_p
with a SCOPE_REF, that it does not handle well.

This patch fixes this by deferring the wrapping into SAVE_EXPR to
instantiation time for templates, when the SCOPE_REF will have been
turned into a COMPONENT_REF.

PR c++/117158

gcc/cp/ChangeLog:

* typeck.cc (cp_build_array_ref): Only wrap array expression
into a SAVE_EXPR at template instantiation time.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/eval-order13.C: New test.
* g++.dg/parse/crash77.C: New test.

(cherry picked from commit b1d92aeb8583c8d1491c97703680c5fb88ed1fe4)

9 months agoDaily bump.
GCC Administrator [Tue, 5 Nov 2024 00:21:42 +0000 (00:21 +0000)] 
Daily bump.

9 months agoDon't call invert on VARYING.
Andrew MacLeod [Mon, 4 Nov 2024 15:02:35 +0000 (10:02 -0500)] 
Don't call invert on VARYING.

When all cases go to one label and resul in a VARYING value, we can't
invert that value to remove all values from the default case. Simply
check for this case and set the default to UNDEFINED.

PR tree-optimization/117398
gcc/
* gimple-range-edge.cc (gimple_outgoing_range::calc_switch_ranges):
Check for VARYING and don't call invert () on it.

gcc/testsuite/
* gcc.dg/pr117398.c: New.

9 months agoAdd regression test
Eric Botcazou [Mon, 4 Nov 2024 10:15:15 +0000 (11:15 +0100)] 
Add regression test

This is for the latest fix made to Selected_Length_Checks in Checks.

gcc/testsuite
* gnat.dg/specs/array7.ads: New test.

9 months agoada: Fix internal error on concatenation of discriminant-dependent component
Eric Botcazou [Fri, 16 Aug 2024 14:03:30 +0000 (16:03 +0200)] 
ada: Fix internal error on concatenation of discriminant-dependent component

This only occurs with optimization enabled, but the expanded code is always
wrong because it reuses the formal parameter of an initialization procedure
associated with a discriminant (a discriminal in GNAT parlance) outside of
the initialization procedure.

gcc/ada/

* checks.adb (Selected_Length_Checks.Get_E_Length): For a
component of a record with discriminants and if the expression is
a selected component, try to build an actual subtype from its
prefix instead of from the discriminal.

9 months agoDaily bump.
GCC Administrator [Mon, 4 Nov 2024 00:20:25 +0000 (00:20 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sun, 3 Nov 2024 00:19:49 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sat, 2 Nov 2024 00:22:10 +0000 (00:22 +0000)] 
Daily bump.

9 months agoFortran: Fix ICE with structure constructor in data statement [PR79685]
Paul Thomas [Fri, 25 Oct 2024 16:59:03 +0000 (17:59 +0100)] 
Fortran: Fix ICE with structure constructor in data statement [PR79685]

2024-10-25  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/79685
* decl.cc (match_data_constant): Find the symtree instead of
the symbol so the use renamed symbols are found. Pass this and
the derived type to gfc_match_structure_constructor.
* match.h: Update prototype of gfc_match_structure_contructor.
* primary.cc (gfc_match_structure_constructor): Remove call to
gfc_get_ha_sym_tree and use caller supplied symtree instead.

gcc/testsuite/
PR fortran/79685
* gfortran.dg/use_rename_13.f90: New test.

(cherry picked from commit 6cb1da72cac166bd3b005c0430557b68b9761da5)

9 months agoDaily bump.
GCC Administrator [Fri, 1 Nov 2024 00:22:13 +0000 (00:22 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Thu, 31 Oct 2024 00:19:44 +0000 (00:19 +0000)] 
Daily bump.

9 months agoFix ICE due to subreg:us_truncate.
liuhongt [Tue, 29 Oct 2024 09:09:39 +0000 (02:09 -0700)] 
Fix ICE due to subreg:us_truncate.

Force_operand issues an ICE when input
is (subreg:DI (us_truncate:V8QI)), it's probably because it's an
invalid rtx, So refine backend patterns for that.

gcc/ChangeLog:

PR target/117318
* config/i386/sse.md (*avx512vl_<code>v2div2qi2_mask_store_1):
Rename to ..
(avx512vl_<code>v2div2qi2_mask_store_1): .. this.
(avx512vl_<code>v2div2qi2_mask_store_2): Change to
define_expand.
(*avx512vl_<code><mode>v4qi2_mask_store_1): Rename to ..
(avx512vl_<code><mode>v4qi2_mask_store_1): .. this.
(avx512vl_<code><mode>v4qi2_mask_store_2): Change to
define_expand.
(*avx512vl_<code><mode>v8qi2_mask_store_1): Rename to ..
(avx512vl_<code><mode>v8qi2_mask_store_1): .. this.
(avx512vl_<code><mode>v8qi2_mask_store_2): Change to
define_expand.
(*avx512vl_<code><mode>v4hi2_mask_store_1): Rename to ..
(avx512vl_<code><mode>v4hi2_mask_store_1): .. this.
(avx512vl_<code><mode>v4hi2_mask_store_2): Change to
define_expand.
(*avx512vl_<code>v2div2hi2_mask_store_1): Rename to ..
(avx512vl_<code>v2div2hi2_mask_store_1): .. this.
(avx512vl_<code>v2div2hi2_mask_store_2): Change to
define_expand.
(*avx512vl_<code>v2div2si2_mask_store_1): Rename to ..
(avx512vl_<code>v2div2si2_mask_store_1): .. this.
(avx512vl_<code>v2div2si2_mask_store_2): Change to
define_expand.
(*avx512f_<code>v8div16qi2_mask_store_1): Rename to ..
(avx512f_<code>v8div16qi2_mask_store_1): .. this.
(avx512f_<code>v8div16qi2_mask_store_2): Change to
define_expand.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit bc0eeccf27a084461a2d5661e23468350acb43da)

9 months agoDaily bump.
GCC Administrator [Wed, 30 Oct 2024 00:20:15 +0000 (00:20 +0000)] 
Daily bump.

9 months agoFix miscompilation of function containing __builtin_unreachable
Eric Botcazou [Tue, 29 Oct 2024 20:40:34 +0000 (21:40 +0100)] 
Fix miscompilation of function containing __builtin_unreachable

This is a wrong-code generation on the SPARC for a function containing
a call to __builtin_unreachable caused by the delay slot scheduling pass,
and more specifically the find_end_label function which has these lines:

  /* Otherwise, see if there is a label at the end of the function. If there
     is, it must be that RETURN insns aren't needed, so that is our return
     label and we don't have to do anything else.  */

The comment was correct 20 years ago but no longer is nowadays in the
presence of RTL epilogues and calls to __builtin_unreachable, so the
patch just removes the associated two lines of code:

  else if (LABEL_P (insn))
    *plabel = as_a <rtx_code_label *> (insn);

and otherwise contains just adjustments to the commentary.

gcc/
PR rtl-optimization/117327
* reorg.cc (find_end_label): Do not return a dangling label at the
end of the function and adjust commentary.

gcc/testsuite/
* gcc.c-torture/execute/20241029-1.c: New test.

9 months agors6000: Fix PTImode handling in power8 swap optimization pass [PR116415]
Peter Bergner [Fri, 23 Aug 2024 16:45:40 +0000 (11:45 -0500)] 
rs6000: Fix PTImode handling in power8 swap optimization pass [PR116415]

Our power8 swap optimization pass has some special handling for optimizing
swaps of TImode variables.  The test case reported in bugzilla uses a call
to  __atomic_compare_exchange, which introduces a variable of PTImode and
that does not get the same treatment as TImode leading to wrong code
generation.  The simple fix is to treat PTImode identically to TImode.

2024-08-23  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/116415
* config/rs6000/rs6000.h (TI_OR_PTI_MODE): New define.
* config/rs6000/rs6000-p8swap.cc (rs6000_analyze_swaps): Use it to
handle PTImode identically to TImode.

gcc/testsuite/
PR target/116415
* gcc.target/powerpc/pr116415.c: New test.

(cherry picked from commit 6e68c3df1540c5bafbb47343698bf4e270333fdb)

9 months agoDaily bump.
GCC Administrator [Tue, 29 Oct 2024 00:20:10 +0000 (00:20 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Mon, 28 Oct 2024 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sun, 27 Oct 2024 00:19:24 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sat, 26 Oct 2024 00:20:30 +0000 (00:20 +0000)] 
Daily bump.

9 months agoFortran: Simplify len_trim with array ref and fix mapping bug[PR84868].
Paul Thomas [Tue, 16 Jul 2024 14:56:44 +0000 (15:56 +0100)] 
Fortran: Simplify len_trim with array ref and fix mapping bug[PR84868].

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

gcc/fortran
PR fortran/84868
* simplify.cc (gfc_simplify_len_trim): If the argument is an
element of a parameter array, simplify all the elements and
build a new parameter array to hold the result, after checking
that it doesn't already exist.
* trans-expr.cc (gfc_get_interface_mapping_array) if a string
length is available, use it for the typespec.
(gfc_add_interface_mapping): Supply the se string length.

gcc/testsuite/
PR fortran/84868
* gfortran.dg/pr84868.f90: New test.

(cherry picked from commit 9f966b6a8ff0244dd6f8bf36d876799d5f9bbaee)

9 months agoFix ICE due to isa mismatch for the builtins.
liuhongt [Tue, 22 Oct 2024 08:54:40 +0000 (01:54 -0700)] 
Fix ICE due to isa mismatch for the builtins.

gcc/ChangeLog:

PR target/117240
* config/i386/i386-builtin.def: Add avx/avx512f to vaes
ymm/zmm builtins.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr117240_avx.c: New test.
* gcc.target/i386/pr117240_avx512f.c: New test.

(cherry picked from commit 403e361d5aa620e77c9832578b2409a0fdd79d96)

9 months agoDaily bump.
GCC Administrator [Thu, 24 Oct 2024 00:22:00 +0000 (00:22 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Wed, 23 Oct 2024 00:21:13 +0000 (00:21 +0000)] 
Daily bump.

9 months ago[GCC13/GCC12] Fix testcase.
liuhongt [Tue, 22 Oct 2024 03:24:23 +0000 (11:24 +0800)] 
[GCC13/GCC12] Fix testcase.

The optimization relies on other patterns which are only available at
GCC14 and obove, so restore the xfail for GCC13/12 branch.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512bw-pr103750-2.c: Add xfail for ia32.

(cherry picked from commit 8b43518a01cbbbafe042b85a48fa09a32948380a)

9 months agoDaily bump.
GCC Administrator [Tue, 22 Oct 2024 00:23:29 +0000 (00:23 +0000)] 
Daily bump.

9 months agors6000: Correct the function code for _AMO_LD_DEC_BOUNDED
Jeevitha [Mon, 21 Oct 2024 09:01:46 +0000 (04:01 -0500)] 
rs6000: Correct the function code for _AMO_LD_DEC_BOUNDED

Corrected the function code for the Atomic Memory Operation "Fetch and Decrement
Bounded", changing it from 0x1A to 0x1C.

2024-10-11 Jeevitha Palanisamy <jeevitha@linux.ibm.com>

gcc/

* config/rs6000/amo.h (enum _AMO_LD): Correct the function code for
_AMO_LD_DEC_BOUNDED.

(cherry picked from commit 1a4c5643a5911d130dfab9a064222baeeb7f9be7)

9 months agoRefine splitters related to "combine vpcmpuw + zero_extend to vpcmpuw"
liuhongt [Wed, 16 Oct 2024 05:43:48 +0000 (13:43 +0800)] 
Refine splitters related to "combine vpcmpuw + zero_extend to vpcmpuw"

r12-6103-g1a7ce8570997eb combines vpcmpuw + zero_extend to vpcmpuw
with the pre_reload splitter, but the splitter transforms the
zero_extend into a subreg which make reload think the upper part is
garbage, it's not correct.

The patch adjusts the zero_extend define_insn_and_split to
define_insn to keep zero_extend.

gcc/ChangeLog:

PR target/117159
* config/i386/sse.md
(*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>):
Change from define_insn_and_split to define_insn.
(*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>):
Ditto.
(*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>):
Ditto.
(*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>):
Ditto.
(*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2):
Split to the zero_extend pattern.
(*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2):
Ditto.
(*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2):
Ditto.
(*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2):
Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr117159.c: New test.
* gcc.target/i386/avx512bw-pr103750-1.c: Remove xfail.
* gcc.target/i386/avx512bw-pr103750-2.c: Remove xfail.

(cherry picked from commit 5259d3927c1c8e3a15b4b844adef59b48c241233)

9 months agoDaily bump.
GCC Administrator [Mon, 21 Oct 2024 00:20:25 +0000 (00:20 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sun, 20 Oct 2024 00:20:23 +0000 (00:20 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sat, 19 Oct 2024 00:21:12 +0000 (00:21 +0000)] 
Daily bump.

9 months agoi386: Fix expand_vector_set for VEC_MERGE/VEC_DUPLICATE RTX [PR117116]
Uros Bizjak [Tue, 15 Oct 2024 14:51:33 +0000 (16:51 +0200)] 
i386: Fix expand_vector_set for VEC_MERGE/VEC_DUPLICATE RTX [PR117116]

Middle end can generate SYMBOL_REF RTX as a value "val" in the call
to expand_vector_set, but SYMBOL_REF RTX is not accepted in
<sse2p4_1>_pinsr<ssemodesuffix> insn pattern, generated via
VEC_MERGE/VEC_DUPLICATE RTX path.

Force the value into a register before VEC_MERGE/VEC_DUPLICATE RTX
is generated if it doesn't satisfy nonimmediate_operand predicate.

PR target/117116

gcc/ChangeLog:

* config/i386/i386-expand.cc (expand_vector_set): Force "val"
into a register before VEC_MERGE/VEC_DUPLICATE RTX is generated
if it doesn't satisfy nonimmediate_operand predicate.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 80d7032067a3a5b76aecd657d9b35b0a8f5a941d)

9 months agoDaily bump.
GCC Administrator [Wed, 16 Oct 2024 11:39:42 +0000 (11:39 +0000)] 
Daily bump.

9 months agotestsuite: fix PR111613 test
Sam James [Mon, 29 Jul 2024 20:47:16 +0000 (21:47 +0100)] 
testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

(cherry picked from commit 5e5d7a88932b132437069f716160f8b20862890b)

9 months agoFix modref's iteraction with store merging
Jan Hubicka [Mon, 22 Jul 2024 17:00:39 +0000 (19:00 +0200)] 
Fix modref's iteraction with store merging

Hi,
this patch fixes wrong code in case store-merging introduces load of function
parameter that was previously write-only (which happens for bitfields).
Without this, the whole store-merged area is consdered to be killed.

PR ipa/111613

gcc/ChangeLog:

* ipa-modref.cc (analyze_parms): Do not preserve EAF_NO_DIRECT_READ and
EAF_NO_INDIRECT_READ from past flags.

gcc/testsuite/ChangeLog:

* gcc.c-torture/pr111613.c: New test.

(cherry picked from commit 14074773350ffed7efdebbc553adf0f23b572e87)

9 months agoFix handling of ICF_NOVOPS in ipa-modref
Jan Hubicka [Mon, 22 Jul 2024 21:01:50 +0000 (23:01 +0200)] 
Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

9 months agoFix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF
Jan Hubicka [Thu, 16 May 2024 13:33:55 +0000 (15:33 +0200)] 
Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

TARGET_MEM_REF can be used to offset constant base into a memory object (to
produce lea instruction).  This confuses points_to_local_or_readonly_memory_p
which treats the constant address as a base of the access.

Bootstrapped/regtsted x86_64-linux, comitted.
Honza

gcc/ChangeLog:

PR ipa/113787
* ipa-fnsummary.cc (points_to_local_or_readonly_memory_p): Do not
look into TARGET_MEM_REFS with constant opreand 0.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr113787.c: New test.

(cherry picked from commit 96d53252aefcbc2fe419c4c3b4bcd3fc03d4d187)

9 months agoFix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced to function...
Jan Hubicka [Mon, 22 Jul 2024 16:08:08 +0000 (18:08 +0200)] 
Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced to function call parameters

modref_eaf_analysis::analyze_ssa_name misinterprets EAF flags.  If dereferenced
parameter is passed (to map_iterator in the testcase) it can be returned
indirectly which in turn makes it to escape into the next function call.

PR ipa/115033

gcc/ChangeLog:

* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Fix checking of
EAF flags when analysing values dereferenced as function parameters.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr115033.c: New test.

(cherry picked from commit cf8ffc58aad3127031c229a75cc4b99c8ace25e0)

9 months agoFix accounting of offsets in unadjusted_ptr_and_unit_offset
Jan Hubicka [Mon, 22 Jul 2024 16:05:26 +0000 (18:05 +0200)] 
Fix accounting of offsets in unadjusted_ptr_and_unit_offset

unadjusted_ptr_and_unit_offset accidentally throws away the offset computed by
get_addr_base_and_unit_offset. Instead of passing extra_offset it passes offset.

PR ipa/114207

gcc/ChangeLog:

* ipa-prop.cc (unadjusted_ptr_and_unit_offset): Fix accounting of offsets in ADDR_EXPR.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr114207.c: New test.

(cherry picked from commit 391f46f10b0586c074014de82efe76787739bb0c)

9 months agoRemove buggy special case in irange::invert [PR109934].
Aldy Hernandez [Tue, 23 May 2023 10:34:45 +0000 (12:34 +0200)] 
Remove buggy special case in irange::invert [PR109934].

This patch removes a buggy special case in irange::invert which seems
to have been broken for a while, and probably never triggered because
the legacy code was handled elsewhere, and the non-legacy code was
using an int_range_max of int_range<255> which made it extremely
likely for num_ranges == 255.  However, with auto-resizing ranges,
int_range_max will start off at 3 and can hit this bogus code in the
unswitching code.

PR tree-optimization/109934

gcc/ChangeLog:

* value-range.cc (irange::invert): Remove buggy special case.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr109934.c: New test.

(cherry picked from commit 8d5f050dabbf6dd3b992c3b46661848dbcf30d9e)

9 months agoAdd regression test
Eric Botcazou [Mon, 14 Oct 2024 09:57:57 +0000 (11:57 +0200)] 
Add regression test

gcc/testsuite/
PR ada/114593
* gnat.dg/specs/generic_inst2-child2.ads: New test.
* gnat.dg/specs/generic_inst2.ads: New helper.
* gnat.dg/specs/generic_inst2-child1.ads: Likewise.

9 months agoada: Type conversion in instance incorrectly rejected.
Steve Baird [Mon, 8 Jul 2024 21:45:55 +0000 (14:45 -0700)] 
ada: Type conversion in instance incorrectly rejected.

In some cases, a legal type conversion in a generic package is correctly
accepted but the corresponding type conversion in an instance of the generic
is incorrectly rejected.

gcc/ada/
PR ada/114593
* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.

9 months agoDaily bump.
GCC Administrator [Mon, 14 Oct 2024 00:19:45 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sun, 13 Oct 2024 00:19:43 +0000 (00:19 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Sat, 12 Oct 2024 00:21:00 +0000 (00:21 +0000)] 
Daily bump.

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

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

9 months agoDaily bump.
GCC Administrator [Wed, 9 Oct 2024 00:21:01 +0000 (00:21 +0000)] 
Daily bump.

9 months agoDaily bump.
GCC Administrator [Tue, 8 Oct 2024 00:20:03 +0000 (00:20 +0000)] 
Daily bump.

9 months agolibstdc++: Fix std::string_view for IL32P16 targets
Jonathan Wakely [Mon, 28 Nov 2022 12:16:21 +0000 (12:16 +0000)] 
libstdc++: Fix std::string_view for IL32P16 targets

For H8/300 with -msx -mn -mint32 the type of (_M_len - __pos) is int,
because int is wider than size_t so the operands are promoted.

libstdc++-v3/ChangeLog:

* include/std/string_view (basic_string_view::copy) Use explicit
template argument for call to std::min<size_t>.
(basic_string_view::substr): Likewise.

9 months agolibstdc++: Initialize base in test allocator's constructor
Jonathan Wakely [Thu, 20 Jun 2024 15:13:10 +0000 (16:13 +0100)] 
libstdc++: Initialize base in test allocator's constructor

This fixes a warning from one of the test allocators:
warning: base class 'class std::allocator<__gnu_test::copy_tracker>' should be explicitly initialized in the copy constructor [-Wextra]

libstdc++-v3/ChangeLog:

* testsuite/util/testsuite_allocator.h (tracker_allocator):
Initialize base class in copy constructor.

(cherry picked from commit e2fb245b07f489ed5bfd9a945e0053b4a3211245)

9 months agolibstdc++: Handle EMLINK and EFTYPE in std::filesystem::remove_all
Jonathan Wakely [Mon, 8 Apr 2024 16:41:00 +0000 (17:41 +0100)] 
libstdc++: Handle EMLINK and EFTYPE in std::filesystem::remove_all

Although POSIX requires ELOOP, FreeBSD documents that openat with
O_NOFOLLOW returns EMLINK if the last component of a filename is a
symbolic link.  Check for EMLINK as well as ELOOP, so that the TOCTTOU
mitigation in remove_all works correctly.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 or the
FreeBSD man page for reference.

According to its man page, DragonFlyBSD also uses EMLINK for this error,
and NetBSD uses its own EFTYPE. OpenBSD follows POSIX and uses EMLINK.

This fixes these failures on FreeBSD:
FAIL: 27_io/filesystem/operations/remove_all.cc  -std=gnu++17 execution test
FAIL: experimental/filesystem/operations/remove_all.cc  -std=gnu++17 execution test

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (remove_all) [__FreeBSD__ || __DragonFly__]:
Check for EMLINK as well as ELOOP.
[__NetBSD__]: Check for EFTYPE as well as ELOOP.

9 months agolibstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399]
Jonathan Wakely [Mon, 10 Jun 2024 13:08:16 +0000 (14:08 +0100)] 
libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399]

The shift operations for dynamic_bitset fail to zero out words where the
non-zero bits were shifted to a completely different word.

For a right shift we don't need to sanitize the unused bits in the high
word, because we know they were already clear and a right shift doesn't
change that.

libstdc++-v3/ChangeLog:

PR libstdc++/115399
* include/tr2/dynamic_bitset (operator>>=): Remove redundant
call to _M_do_sanitize.
* include/tr2/dynamic_bitset.tcc (_M_do_left_shift): Zero out
low bits in words that should no longer be populated.
(_M_do_right_shift): Likewise for high bits.
* testsuite/tr2/dynamic_bitset/pr115399.cc: New test.

(cherry picked from commit bd3a312728fbf8c35a09239b9180269f938f872e)