13.0.1-0.3

This commit is contained in:
Jakub Jelinek 2023-02-08 15:30:40 +01:00
parent e346cea2fb
commit 6f673bac47
6 changed files with 176 additions and 69 deletions

1
.gitignore vendored
View File

@ -88,3 +88,4 @@
/gcc-13.0.1-20230117.tar.xz
/gcc-13.0.1-20230127.tar.xz
/newlib-cygwin-9e09d6ed83cce4777a5950412647ccc603040409.tar.xz
/gcc-13.0.1-20230208.tar.xz

View File

@ -1,5 +1,5 @@
%global DATE 20230127
%global gitrev 4faac89a6b542c0d94019eeadc333ef789f37c9d
%global DATE 20230208
%global gitrev 88db57a1779f3c620653a2a791e54301645befbf
%global gcc_version 13.0.1
%global gcc_major 13
# Note, gcc_release must be integer, if you want to add suffixes to
@ -136,7 +136,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: %{gcc_release}.2%{?dist}
Release: %{gcc_release}.3%{?dist}
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
# GCC Runtime Exception.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
@ -286,7 +286,8 @@ Patch8: gcc13-no-add-needed.patch
Patch9: gcc13-Wno-format-security.patch
Patch10: gcc13-rh1574936.patch
Patch11: gcc13-d-shared-libphobos.patch
Patch12: gcc13-pr106746-revert.patch
Patch12: gcc13-pr108692.patch
Patch13: gcc13-pr108316.patch
Patch50: isl-rh2155127.patch
@ -457,9 +458,11 @@ programs with the GNU Compiler Collection.
%package -n libgfortran
Summary: Fortran runtime
Autoreq: true
%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%if %{build_libquadmath}
Requires: libquadmath = %{version}-%{release}
%endif
%endif
%description -n libgfortran
This package contains Fortran shared library which is needed to run
@ -861,7 +864,8 @@ so that there cannot be any synchronization problems.
%patch10 -p0 -b .rh1574936~
%endif
%patch11 -p0 -b .d-shared-libphobos~
%patch12 -p0 -b .pr106746-revert~
%patch12 -p0 -b .pr108692~
%patch13 -p0 -b .pr108316~
%patch50 -p0 -b .rh2155127~
touch -r isl-0.24/m4/ax_prog_cxx_for_build.m4 isl-0.24/m4/ax_prog_cc_for_build.m4
@ -3458,6 +3462,31 @@ end
%endif
%changelog
* Wed Feb 8 2023 Jakub Jelinek <jakub@redhat.com> 13.0.1-0.3
- update from trunk
- PRs analyzer/108616, analyzer/108633, analyzer/108661, c++/101071,
c++/102870, c++/107461, c++/107593, c++/107755, c++/108158,
c++/108559, c++/108579, c++/108597, c++/108607, c++/96745, c/108150,
c/108192, debug/106746, debug/108573, driver/108572, fortran/103506,
fortran/108450, fortran/108451, fortran/108453, fortran/108527,
fortran/108592, fortran/108609, fortran/95107, ipa/107300, ipa/108384,
ipa/108509, ipa/108511, libstdc++/108636, libstdc++/108672,
middle-end/108435, middle-end/108500, middle-end/108625,
modula2/107234, modula2/108135, modula2/108462, modula2/108551,
modula2/108612, rtl-optimization/108086, rtl-optimization/108463,
rtl-optimization/108508, rtl-optimization/108596, sanitizer/108106,
target/104921, target/107674, target/108443, target/108484,
target/108589, target/108599, testsuite/108604, testsuite/108632,
tree-optimization/26854, tree-optimization/106433,
tree-optimization/106923, tree-optimization/107570,
tree-optimization/108356, tree-optimization/108359,
tree-optimization/108385, tree-optimization/108574,
tree-optimization/108582, tree-optimization/108601,
tree-optimization/108608, tree-optimization/108639,
tree-optimization/108647, tree-optimization/108655
- drop libgfortran dependency on libquadmath for F28+ or RHEL8+, gcc-gfortran
still needs to depend on both libquadmath and libquadmath-devel though
* Sat Jan 28 2023 Jakub Jelinek <jakub@redhat.com> 13.0.1-0.2
- update from trunk
- PRs analyzer/108455, analyzer/108507, analyzer/108524, bootstrap/90543,

View File

@ -1,63 +0,0 @@
Revert:
[PR106746] drop cselib addr lookup in debug insn mem
The testcase used to get scheduled differently depending on the
presence of debug insns with MEMs. It's not clear to me why those
MEMs affected scheduling, but the cselib pre-canonicalization of the
MEM address is not used at all when analyzing debug insns, so the
memory allocation and lookup are pure waste. Somehow, avoiding that
waste fixes the problem, or makes it go latent.
2023-01-19 Alexandre Oliva <oliva@adacore.com>
PR debug/106746
* sched-deps.cc (sched_analyze_2): Skip cselib address lookup
within debug insns.
--- gcc/sched-deps.cc
+++ gcc/sched-deps.cc
@@ -2605,26 +2605,26 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn)
case MEM:
{
- if (!DEBUG_INSN_P (insn))
- {
- /* Reading memory. */
- rtx_insn_list *u;
- rtx_insn_list *pending;
- rtx_expr_list *pending_mem;
- rtx t = x;
+ /* Reading memory. */
+ rtx_insn_list *u;
+ rtx_insn_list *pending;
+ rtx_expr_list *pending_mem;
+ rtx t = x;
- if (sched_deps_info->use_cselib)
- {
- machine_mode address_mode = get_address_mode (t);
-
- t = shallow_copy_rtx (t);
- cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
- GET_MODE (t), insn);
- XEXP (t, 0)
- = cselib_subst_to_values_from_insn (XEXP (t, 0), GET_MODE (t),
- insn);
- }
+ if (sched_deps_info->use_cselib)
+ {
+ machine_mode address_mode = get_address_mode (t);
+
+ t = shallow_copy_rtx (t);
+ cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
+ GET_MODE (t), insn);
+ XEXP (t, 0)
+ = cselib_subst_to_values_from_insn (XEXP (t, 0), GET_MODE (t),
+ insn);
+ }
+ if (!DEBUG_INSN_P (insn))
+ {
t = canon_rtx (t);
pending = deps->pending_read_insns;
pending_mem = deps->pending_read_mems;

66
gcc13-pr108316.patch Normal file
View File

@ -0,0 +1,66 @@
vect: Check gather/scatter offset types [PR108316]
The gather/scatter support can over-widen an offset if the target
requires it, but this relies on using a pattern sequence to add
the widening conversion. That failed in the testcase because an
earlier pattern (bool) took priority.
I think we should allow patterns to be applied to other patterns,
but that's quite an invasive change and isn't suitable for stage 4.
This patch instead punts if the offset type doesn't match the
expected one.
If we switched to using the SLP representation for everything,
we would probably handle both patterns by rewriting the graph,
which should be much easier.
gcc/
PR tree-optimization/108316
* tree-vect-stmts.cc (get_load_store_type): When using
internal functions for gather/scatter, make sure that the type
of the offset argument is consistent with the offset vector type.
gcc/testsuite/
PR tree-optimization/108316
* gcc.dg/vect/pr108316.c: New test.
--- gcc/tree-vect-stmts.cc
+++ gcc/tree-vect-stmts.cc
@@ -2474,6 +2474,23 @@ get_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
*memory_access_type = VMAT_GATHER_SCATTER;
if (!vect_check_gather_scatter (stmt_info, loop_vinfo, gs_info))
gcc_unreachable ();
+ /* When using internal functions, we rely on pattern recognition
+ to convert the type of the offset to the type that the target
+ requires, with the result being a call to an internal function.
+ If that failed for some reason (e.g. because another pattern
+ took priority), just handle cases in which the offset already
+ has the right type. */
+ else if (gs_info->ifn != IFN_LAST
+ && !is_gimple_call (stmt_info->stmt)
+ && !tree_nop_conversion_p (TREE_TYPE (gs_info->offset),
+ TREE_TYPE (gs_info->offset_vectype)))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "%s offset requires a conversion\n",
+ vls_type == VLS_LOAD ? "gather" : "scatter");
+ return false;
+ }
else if (!vect_is_simple_use (gs_info->offset, vinfo,
&gs_info->offset_dt,
&gs_info->offset_vectype))
--- gcc/testsuite/gcc.dg/vect/pr108316.c
+++ gcc/testsuite/gcc.dg/vect/pr108316.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+extern _Bool a[];
+
+void
+foo (short i, int b[][64][1])
+{
+ for (; i < 64; i += 4)
+ a[i] = b[0][i] != 0;
+}

74
gcc13-pr108692.patch Normal file
View File

@ -0,0 +1,74 @@
2023-02-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/108692
* tree-vect-patterns.cc (vect_widened_op_tree): If rhs_code is
widened_code which is different from code, don't call
vect_look_through_possible_promotion but instead just check op is
SSA_NAME with integral type for which vect_is_simple_use is true
and call set_op on this_unprom.
* gcc.dg/pr108692.c: New test.
--- gcc/tree-vect-patterns.cc.jj 2023-01-02 09:32:45.635949342 +0100
+++ gcc/tree-vect-patterns.cc 2023-02-07 15:27:33.214608837 +0100
@@ -601,7 +601,25 @@ vect_widened_op_tree (vec_info *vinfo, s
if (shift_p && i == 1)
return 0;
- if (!vect_look_through_possible_promotion (vinfo, op, this_unprom))
+ if (rhs_code != code)
+ {
+ /* If rhs_code is widened_code, don't look through further
+ possible promotions, there is a promotion already embedded
+ in the WIDEN_*_EXPR. */
+ if (TREE_CODE (op) != SSA_NAME
+ || !INTEGRAL_TYPE_P (TREE_TYPE (op)))
+ return 0;
+
+ stmt_vec_info def_stmt_info;
+ gimple *def_stmt;
+ vect_def_type dt;
+ if (!vect_is_simple_use (op, vinfo, &dt, &def_stmt_info,
+ &def_stmt))
+ return 0;
+ this_unprom->set_op (op, dt, NULL);
+ }
+ else if (!vect_look_through_possible_promotion (vinfo, op,
+ this_unprom))
return 0;
if (TYPE_PRECISION (this_unprom->type) == TYPE_PRECISION (type))
--- gcc/testsuite/gcc.dg/pr108692.c.jj 2023-02-07 15:47:20.329076264 +0100
+++ gcc/testsuite/gcc.dg/pr108692.c 2023-02-07 15:46:15.623031983 +0100
@@ -0,0 +1,31 @@
+/* PR tree-optimization/108692 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+__attribute__((noipa)) int
+foo (signed char *x, signed char *y, int n)
+{
+ int i, r = 0;
+ signed char a, b;
+ for (i = 0; i < n; i++)
+ {
+ a = x[i];
+ b = y[i];
+ int c = (unsigned char) a - (unsigned char) b;
+ r = r + (c < 0 ? -c : c);
+ }
+ return r;
+}
+
+int
+main ()
+{
+ signed char x[64] = {}, y[64] = {};
+ if (__CHAR_BIT__ != 8 || __SIZEOF_INT__ != 4)
+ return 0;
+ x[32] = -128;
+ y[32] = 1;
+ if (foo (x, y, 64) != 127)
+ __builtin_abort ();
+ return 0;
+}

View File

@ -1,4 +1,4 @@
SHA512 (gcc-13.0.1-20230127.tar.xz) = 437494fad0d688d8c81d1bc6827bb139894fc74af4ca2d2a71dc7332304a988c4a358af38ffc15ab7c19fd5172398d00d6447301f560517d03a5367967694906
SHA512 (gcc-13.0.1-20230208.tar.xz) = 55a0d2b5ec00fa83c96b4df9fff77d93020aad808682d9c1bd87f7aed8ecc259b044ae800957ff6fa42c8f6e77cbb2f2cd2f83ff824f584de10bdd1caf201f40
SHA512 (isl-0.24.tar.bz2) = aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c38231af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95
SHA512 (newlib-cygwin-9e09d6ed83cce4777a5950412647ccc603040409.tar.xz) = bef3fa04f7b1a915fc1356ebed114698b5cc835e9fa04b0becff05a9efc76c59fb376482990873d222d7acdcfee3c4f30f5a4cb7f3be1f291f1fa5f1c7a9d983
SHA512 (nvptx-tools-472b6e78b3ba918d727698f79911360b7c808247.tar.xz) = 91690321bf96460c3b3e229199a6f752ed1c27c6933d4345dc7e237dc068f604ad211bb3a0373e14d4f332bee05b6227d6933e14e0b475ffdfea8b511ab735e6