Commit Graph

195235 Commits

Author SHA1 Message Date
GCC Administrator
5ed7b592d8 Daily bump. 2024-11-23 00:24:30 +00:00
GCC Administrator
f5d64b323f Daily bump. 2024-11-22 00:22:04 +00:00
GCC Administrator
63d679a141 Daily bump. 2024-11-21 00:22:28 +00:00
GCC Administrator
61ce58768a Daily bump. 2024-11-20 00:21:13 +00:00
Uros Bizjak
540c0c7c42 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 344356f781)
2024-11-19 18:28:30 +01:00
GCC Administrator
2bca9b85f4 Daily bump. 2024-11-19 00:20:33 +00:00
Georg-Johann Lay
a2725b4ed6 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 bba27015f2)
2024-11-18 18:30:48 +01:00
GCC Administrator
c6646b5a74 Daily bump. 2024-11-18 00:21:34 +00:00
GCC Administrator
d0bb7a14ff Daily bump. 2024-11-17 00:24:56 +00:00
GCC Administrator
178b89f76e Daily bump. 2024-11-16 00:20:38 +00:00
GCC Administrator
d01a31607a Daily bump. 2024-11-15 00:20:23 +00:00
GCC Administrator
169f70a693 Daily bump. 2024-11-14 17:21:45 +00:00
John David Anglin
424bd4c3d1 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.
2024-11-13 09:43:16 -05:00
Hu, Lin1
e41fdca8a2 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 2272cd2508)
2024-11-13 15:08:51 +08:00
GCC Administrator
3fd7c03400 Daily bump. 2024-11-13 00:20:50 +00:00
John David Anglin
571a5103a1 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.
2024-11-12 14:28:24 -05:00
GCC Administrator
a1500fe4a1 Daily bump. 2024-11-12 00:21:19 +00:00
GCC Administrator
6f01cab324 Daily bump. 2024-11-11 00:19:12 +00:00
GCC Administrator
dfea9abfb4 Daily bump. 2024-11-10 00:19:35 +00:00
GCC Administrator
9336065d8c Daily bump. 2024-11-09 16:05:14 +00:00
GCC Administrator
6235b5806c Daily bump. 2024-11-07 00:20:45 +00:00
GCC Administrator
7cf0948696 Daily bump. 2024-11-06 00:21:21 +00:00
Simon Martin
5fdd38d576 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 b1d92aeb85)
2024-11-05 14:59:04 +01:00
GCC Administrator
a48d9c7fa3 Daily bump. 2024-11-05 00:21:42 +00:00
Andrew MacLeod
78d3156d53 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.
2024-11-04 14:46:31 -05:00
Eric Botcazou
db2611e392 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.
2024-11-04 11:50:37 +01:00
Eric Botcazou
d2061812ea 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.
2024-11-04 11:50:31 +01:00
GCC Administrator
ea81f22327 Daily bump. 2024-11-04 00:20:25 +00:00
GCC Administrator
fd1fb86d62 Daily bump. 2024-11-03 00:19:49 +00:00
GCC Administrator
11af155ac0 Daily bump. 2024-11-02 00:22:10 +00:00
Paul Thomas
5210bf4d49 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 6cb1da72ca)
2024-11-01 10:31:19 +00:00
GCC Administrator
94334ab83b Daily bump. 2024-11-01 00:22:13 +00:00
GCC Administrator
49971d35ef Daily bump. 2024-10-31 00:19:44 +00:00
liuhongt
d0a932fb53 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 bc0eeccf27)
2024-10-30 05:01:33 -07:00
GCC Administrator
0bc4a352e2 Daily bump. 2024-10-30 00:20:15 +00:00
Eric Botcazou
0711e018b7 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.
2024-10-29 21:55:10 +01:00
Peter Bergner
eeb72f26ea 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 6e68c3df15)
2024-10-28 22:38:48 -05:00
GCC Administrator
7f13d0705d Daily bump. 2024-10-29 00:20:10 +00:00
GCC Administrator
b2cd6ae7b3 Daily bump. 2024-10-28 00:19:06 +00:00
GCC Administrator
56b972db40 Daily bump. 2024-10-27 00:19:24 +00:00
GCC Administrator
69a55cea0e Daily bump. 2024-10-26 00:20:30 +00:00
Paul Thomas
b5211c13cf 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 9f966b6a8f)
2024-10-25 09:58:06 +01:00
liuhongt
ab84a8a4b7 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 403e361d5a)
2024-10-23 17:56:40 -07:00
GCC Administrator
ac222968c3 Daily bump. 2024-10-24 00:22:00 +00:00
GCC Administrator
fde31ceb46 Daily bump. 2024-10-23 00:21:13 +00:00
liuhongt
45bde60836 [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 8b43518a01)
2024-10-22 11:28:24 +08:00
GCC Administrator
2db070cbf9 Daily bump. 2024-10-22 00:23:29 +00:00
Jeevitha
41377d0f4e 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 1a4c5643a5)
2024-10-21 04:01:46 -05:00
liuhongt
91800a70a2 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 5259d3927c)
2024-10-21 10:31:20 +08:00
GCC Administrator
69c50a3588 Daily bump. 2024-10-21 00:20:25 +00:00