!422 Sync bug fix patch from openeuler/gcc

From: @tiancheng-bao 
Reviewed-by: @huang-xiaoquan 
Signed-off-by: @huang-xiaoquan
This commit is contained in:
openeuler-ci-bot 2024-05-11 08:32:26 +00:00 committed by Gitee
commit fe2575b640
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 143 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 01517aa2397f854ffa96128a0fb23dd5542be709 Mon Sep 17 00:00:00 2001
From: Chernonog Viacheslav <chernonog.vyacheslav@huawei.com>
Date: Tue, 30 Apr 2024 18:43:32 +0800
Subject: [PATCH 1/4] [double-sized-mul][testsuite] Add march armv8.2-a for dg
tests
---
gcc/testsuite/gcc.dg/double_sized_mul-1.c | 2 +-
gcc/testsuite/gcc.dg/double_sized_mul-2.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/double_sized_mul-1.c b/gcc/testsuite/gcc.dg/double_sized_mul-1.c
index 4d475cc8a..d32a25223 100644
--- a/gcc/testsuite/gcc.dg/double_sized_mul-1.c
+++ b/gcc/testsuite/gcc.dg/double_sized_mul-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* fif-conversion-gimple and fuaddsub-overflow-match-all are required for
proper overflow detection in some cases. */
-/* { dg-options "-O2 -fif-conversion-gimple -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-options "-O2 -fif-conversion-gimple -march=armv8.2-a -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
#include <stdint.h>
typedef unsigned __int128 uint128_t;
diff --git a/gcc/testsuite/gcc.dg/double_sized_mul-2.c b/gcc/testsuite/gcc.dg/double_sized_mul-2.c
index cc6e5af25..ff35902b7 100644
--- a/gcc/testsuite/gcc.dg/double_sized_mul-2.c
+++ b/gcc/testsuite/gcc.dg/double_sized_mul-2.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* fif-conversion-gimple is required for proper overflow detection
in some cases. */
-/* { dg-options "-O2 -fif-conversion-gimple -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-options "-O2 -fif-conversion-gimple -march=armv8.2-a -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
#include <stdint.h>
typedef unsigned __int128 uint128_t;
--
2.33.0

View File

@ -0,0 +1,34 @@
From b84a896e2df214b08d6519a097cc410d3e582add Mon Sep 17 00:00:00 2001
From: Diachkov Ilia <diachkov.ilia1@huawei-partners.com>
Date: Wed, 8 May 2024 21:28:32 +0800
Subject: [PATCH 2/4] [IPA][Bugfix] Fix fails in IPA prefetch
(src-openEuler/gcc: I9J6N6)
---
gcc/ipa-prefetch.cc | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/ipa-prefetch.cc b/gcc/ipa-prefetch.cc
index 1ceb5137f..94290ea9c 100644
--- a/gcc/ipa-prefetch.cc
+++ b/gcc/ipa-prefetch.cc
@@ -1432,8 +1432,14 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
TREE_SIDE_EFFECTS (*tp) = TREE_SIDE_EFFECTS (old);
TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
- /* TODO: maybe support this case. */
- gcc_assert (MR_DEPENDENCE_CLIQUE (old) == 0);
+ if (MR_DEPENDENCE_CLIQUE (old) != 0)
+ {
+ MR_DEPENDENCE_CLIQUE (*tp) = MR_DEPENDENCE_CLIQUE (old);
+ MR_DEPENDENCE_BASE (*tp) = MR_DEPENDENCE_BASE (old);
+ if (dump_file)
+ fprintf (dump_file, "Copy clique=%d base=%d info.\n",
+ MR_DEPENDENCE_CLIQUE (old), MR_DEPENDENCE_BASE (old));
+ }
/* We cannot propagate the TREE_THIS_NOTRAP flag if we have
remapped a parameter as the property might be valid only
for the parameter itself. */
--
2.33.0

View File

@ -0,0 +1,29 @@
From acb6bbf0612aead00a879892ba8ed816c90fe788 Mon Sep 17 00:00:00 2001
From: Chernonog Viacheslav <chernonog.vyacheslav@huawei.com>
Date: Wed, 8 May 2024 19:24:27 +0800
Subject: [PATCH 3/4] [AES][Bugfix] Change set_of to reg_set_p, and add check
for global_regs fix for I9JDHE
---
gcc/rtl-matcher.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/rtl-matcher.h b/gcc/rtl-matcher.h
index 6aed8d98d..5310f6266 100644
--- a/gcc/rtl-matcher.h
+++ b/gcc/rtl-matcher.h
@@ -56,8 +56,9 @@ check_def_chain_ref (df_ref ref, rtx reg)
if (!ref || !DF_REF_INSN_INFO (ref))
return false;
- return !global_regs[REGNO (reg)]
- || set_of (reg, DF_REF_INSN (ref));
+ return !(REGNO (reg) < FIRST_PSEUDO_REGISTER
+ && global_regs[REGNO (reg)])
+ || reg_set_p (reg, DF_REF_INSN (ref));
}
/* Get the single def instruction of the reg being used in the insn. */
--
2.33.0

View File

@ -0,0 +1,26 @@
From 48724ee73cd58b67d59962ee4d56ac85db797e61 Mon Sep 17 00:00:00 2001
From: tiancheng-bao <baotiancheng1@huawei.com>
Date: Fri, 10 May 2024 17:52:27 +0800
Subject: [PATCH 4/4] fix bugs within pointer compression and DFE
---
gcc/ipa-struct-reorg/ipa-struct-reorg.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
index 2257d3528..1a169c635 100644
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
@@ -7472,9 +7472,6 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi)
continue;
tree lhs_expr = newlhs[i] ? newlhs[i] : lhs;
tree rhs_expr = newrhs[i] ? newrhs[i] : rhs;
- if (!useless_type_conversion_p (TREE_TYPE (lhs_expr),
- TREE_TYPE (rhs_expr)))
- rhs_expr = gimplify_build1 (gsi, NOP_EXPR, TREE_TYPE (lhs_expr), rhs_expr);
gimple *newstmt = gimple_build_assign (lhs_expr, rhs_expr);
if (dump_file && (dump_flags & TDF_DETAILS))
{
--
2.33.0

View File

@ -2,7 +2,7 @@
%global gcc_major 12
# 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 28
%global gcc_release 29
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
@ -199,6 +199,11 @@ Patch86: 0086-Modfify-cost-calculation-for-dealing-with-equivalenc.patch
Patch87: 0087-Add-cost-calculation-for-reg-equivalence-invariants.patch
Patch88: 0088-BUGFIX-Fix-the-configure-file-of-BOLT.patch
Patch89: 0089-StructReorderFields-Fix-gimple-call-not-rewritten.patch
Patch90: 0090-double-sized-mul-testsuite-Add-march-armv8.2-a-for-d.patch
Patch91: 0091-IPA-Bugfix-Fix-fails-in-IPA-prefetch-src-openEuler-g.patch
Patch92: 0092-AES-Bugfix-Change-set_of-to-reg_set_p-and-add-check-.patch
Patch93: 0093-fix-bugs-within-pointer-compression-and-DFE.patch
# Part 3000 ~ 4999
%ifarch loongarch64
@ -859,6 +864,10 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch87 -p1
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch92 -p1
%patch93 -p1
%ifarch loongarch64
%patch3001 -p1
@ -3254,6 +3263,10 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Sat May 11 2024 tiancheng-bao <baotiancheng1@huawei.com> - 12.3.1-29
- Type: Sync
- DESC: Sync bug fix patch from openeuler/gcc
* Mon Apr 29 2024 huang-xiaoquan <huangxiaoquan1@huawei.com> - 12.3.1-28
- Type: BUGFIX
- DESC: StructReorderFields-Fix-gimple-call-not-rewritten.