Compare commits

..

No commits in common. "c8" and "a8-beta" have entirely different histories.
c8 ... a8-beta

3 changed files with 7 additions and 151 deletions

View File

@ -1,59 +0,0 @@
2024-04-18 Jakub Jelinek <jakub@redhat.com>
* tree-vect-stmts.c (vectorizable_call): For j == 0 use
vargs.safe_grow (nargs) rather than vargs.create (nargs), for j != 0
remove vargs.truncate (0). Instead of vargs.quick_push store into
vargs[i]. Use vargs[i] instead of gimple_call_arg (new_stmt, i)
if j != 0.
* gcc.c-torture/compile/20240418.c: New test.
--- gcc/tree-vect-stmts.c.jj 2021-04-22 15:48:48.228178359 +0200
+++ gcc/tree-vect-stmts.c 2024-04-18 13:21:46.104061529 +0200
@@ -3242,9 +3242,7 @@ vectorizable_call (gimple *gs, gimple_st
{
/* Build argument list for the vectorized call. */
if (j == 0)
- vargs.create (nargs);
- else
- vargs.truncate (0);
+ vargs.safe_grow (nargs);
if (slp_node)
{
@@ -3252,7 +3250,7 @@ vectorizable_call (gimple *gs, gimple_st
vec<tree> vec_oprnds0;
for (i = 0; i < nargs; i++)
- vargs.quick_push (gimple_call_arg (stmt, i));
+ vargs[i] = gimple_call_arg (stmt, i);
vect_get_slp_defs (vargs, slp_node, &vec_defs);
vec_oprnds0 = vec_defs[0];
@@ -3314,13 +3312,10 @@ vectorizable_call (gimple *gs, gimple_st
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
else
- {
- vec_oprnd0 = gimple_call_arg (new_stmt, i);
- vec_oprnd0
- = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0);
- }
+ vec_oprnd0
+ = vect_get_vec_def_for_stmt_copy (dt[i], vargs[i]);
- vargs.quick_push (vec_oprnd0);
+ vargs[i] = vec_oprnd0;
}
if (gimple_call_internal_p (stmt)
--- gcc/testsuite/gcc.c-torture/compile/20240418.c.jj 2024-04-18 13:24:10.180065661 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20240418.c 2024-04-18 13:19:12.166194018 +0200
@@ -0,0 +1,7 @@
+void
+foo (signed char *p, unsigned long long *q)
+{
+ int i;
+ for (i = 0; i <= 64; i++)
+ *p++ = __builtin_popcountll (*q++);
+}

View File

@ -1,74 +0,0 @@
commit ba374dfb937a8ac1c7c4740913331951a924f88b
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed May 12 10:38:35 2021 +0200
expand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]
The inliner doesn't remap DEBUG_EXPR_DECLs, so the same decls can appear
in multiple functions.
Furthermore, expansion reuses corresponding DEBUG_EXPRs too, so they again
can be reused in multiple functions.
Neither of that is a major problem, DEBUG_EXPRs are just magic value holders
and what value they stand for is independent in each function and driven by
what debug stmts or DEBUG_INSNs they are bound to.
Except for DEBUG_EXPR*s with vector types, TYPE_MODE can be either BLKmode
or some vector mode depending on whether current function's enabled ISAs
support that vector mode or not. On the following testcase, we expand it
first in foo function without AVX2 enabled and so the DEBUG_EXPR is
BLKmode, but later the same DEBUG_EXPR_DECL is used in a simd clone with
AVX2 enabled and expansion ICEs because of a mode mismatch.
The following patch fixes that by forcing recreation of a DEBUG_EXPR if
there is a mode mismatch for vector typed DEBUG_EXPR_DECL, DEBUG_EXPRs
will be still reused in between functions otherwise and within the same
function the mode should be always the same.
2021-05-12 Jakub Jelinek <jakub@redhat.com>
PR middle-end/100508
* cfgexpand.c (expand_debug_expr): For DEBUG_EXPR_DECL with vector
type, don't reuse DECL_RTL if it has different mode, instead force
creation of a new DEBUG_EXPR.
* gcc.dg/gomp/pr100508.c: New test.
(cherry picked from commit 19040050aa2c8ee890fc58dda48639fc91bf0af0)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index b1535e15d28..a7d05202184 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4358,7 +4358,12 @@ expand_debug_expr (tree exp)
op0 = DECL_RTL_IF_SET (exp);
if (op0)
- return op0;
+ {
+ if (GET_MODE (op0) != mode)
+ gcc_assert (VECTOR_TYPE_P (TREE_TYPE (exp)));
+ else
+ return op0;
+ }
op0 = gen_rtx_DEBUG_EXPR (mode);
DEBUG_EXPR_TREE_DECL (op0) = exp;
diff --git a/gcc/testsuite/gcc.dg/gomp/pr100508.c b/gcc/testsuite/gcc.dg/gomp/pr100508.c
new file mode 100644
index 00000000000..c3fa2fc258e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr100508.c
@@ -0,0 +1,14 @@
+/* PR middle-end/100508 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fopenmp-simd" } */
+
+typedef int __attribute__((__vector_size__(32))) V;
+V j;
+
+#pragma omp declare simd
+int
+foo (void)
+{
+ V m = j;
+ return 0;
+}

View File

@ -4,7 +4,7 @@
%global gcc_major 8
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 24
%global gcc_release 21
%global nvptx_tools_gitrev c28050f60193b3b95a18866a96f03334e874e78f
%global nvptx_newlib_gitrev aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24
%global _unpackaged_files_terminate_build 0
@ -104,7 +104,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: %{gcc_release}%{?dist}
Release: %{gcc_release}%{?dist}.alma.1
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
# GCC Runtime Exception.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
@ -306,8 +306,6 @@ Patch45: gcc8-pr99074.patch
Patch46: gcc8-pr87723.patch
Patch47: gcc8-pr111039.patch
Patch48: gcc8-pr111070.patch
Patch49: gcc8-RHEL-32886.patch
Patch50: gcc8-pr100508.patch
Patch1000: nvptx-tools-no-ptxas.patch
Patch1001: nvptx-tools-build.patch
@ -931,8 +929,6 @@ so that there cannot be any synchronization problems.
%patch46 -p1 -b .pr87723~
%patch47 -p1 -b .pr111039~
%patch48 -p1 -b .pr111070~
%patch49 -p0 -b .32886~
%patch50 -p1 -b .pr100508~
cd nvptx-tools-%{nvptx_tools_gitrev}
%patch1000 -p1 -b .nvptx-tools-no-ptxas~
@ -1025,7 +1021,7 @@ CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
--target nvptx-none --enable-as-accelerator-for=%{gcc_target_platform} \
--enable-languages=c,c++,fortran,lto \
--prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--with-bugurl=http://bugzilla.redhat.com/bugzilla \
--with-bugurl=http://bugs.almalinux.org/ \
--enable-checking=release --with-system-zlib \
--with-gcc-major-version-only --without-isl
make %{?_smp_mflags}
@ -1051,7 +1047,7 @@ enablelgo=,go
%endif
CONFIGURE_OPTS="\
--prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--with-bugurl=http://bugzilla.redhat.com/bugzilla \
--with-bugurl=http://bugs.almalinux.org/ \
--enable-shared --enable-threads=posix --enable-checking=release \
%ifarch ppc64le
--enable-targets=powerpcle-linux \
@ -2684,7 +2680,7 @@ fi
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o
%endif
%{_prefix}/libexec/getconf/default
%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog*
%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog*
%{!?_licensedir:%global license %%doc}
%license gcc/COPYING* COPYING.RUNTIME
@ -3340,14 +3336,8 @@ fi
%{ANNOBIN_GCC_PLUGIN_DIR}/gcc-annobin.so.0.0.0
%changelog
* Mon Feb 24 2025 Marek Polacek <polacek@redhat.com> 8.5.0-24
- don't reuse DEBUG_EXPRs with vector type (PR middle-end/100508, RHEL-79501)
* Fri Feb 7 2025 Marek Polacek <polacek@redhat.com> 8.5.0-23
- rebuild for CVE-2020-11023 (RHEL-78274)
* Thu Apr 18 2024 Marek Polacek <polacek@redhat.com> 8.5.0-22
- fix ICE in the vectorizer (RHEL-32886)
* Wed Mar 27 2024 Eduard Abdullin <eabdullin@almalinux.org> - 8.5.0-21.alma.1
- AlmaLinux changes
* Wed Oct 4 2023 Marek Polacek <polacek@redhat.com> 8.5.0-21
- guard the bit test merging code in if-combine (RHEL-11483)
@ -3374,7 +3364,6 @@ fi
* Wed Jul 20 2022 Marek Polacek <polacek@redhat.com> 8.5.0-15
- backport straight-line-speculation mitigation (#2108721)
* Fri Jul 8 2022 Jonathan Wakely <jwakely@redhat.com> 8.5.0-14
- backport std::regex check for invalid range (#2001788)