!17 Fix ICE with building ComputeLibrary

Merge pull request !17 from eastb233/master
This commit is contained in:
openeuler-ci-bot 2020-06-29 15:19:03 +08:00 committed by Gitee
commit 5a315143b0
4 changed files with 128 additions and 5 deletions

66
Fix-PR94185.patch Normal file
View File

@ -0,0 +1,66 @@
This backport contains 1 patch from gcc main stream tree.
The commit id of these patchs list as following in the order of time.
0001-Fix-PR94185-Do-not-reuse-insn-alternative-after-chan.patch
bae7b38cf8a21e068ad5c0bab089dedb78af3346
diff -uprN a/gcc/lra-spills.c b/gcc/lra-spills.c
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -427,7 +427,17 @@ remove_pseudos (rtx *loc, rtx_insn *insn)
and avoid LRA cycling in case of subreg memory reload. */
res = remove_pseudos (&SUBREG_REG (*loc), insn);
if (GET_CODE (SUBREG_REG (*loc)) == MEM)
- alter_subreg (loc, false);
+ {
+ alter_subreg (loc, false);
+ if (GET_CODE (*loc) == MEM)
+ {
+ lra_get_insn_recog_data (insn)->used_insn_alternative = -1;
+ if (lra_dump_file != NULL)
+ fprintf (lra_dump_file,
+ "Memory subreg was simplified in in insn #%u\n",
+ INSN_UID (insn));
+ }
+ }
return res;
}
else if (code == REG && (i = REGNO (*loc)) >= FIRST_PSEUDO_REGISTER
diff -uprN a/gcc/testsuite/g++.target/i386/pr94185.C b/gcc/testsuite/g++.target/i386/pr94185.C
new file mode 100644
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr94185.C
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIE -fstack-protector-strong" } */
+
+struct a {
+ int b;
+ int c();
+ a() : b(c()) {}
+ ~a();
+ char *e();
+};
+struct f {
+ void g(int);
+};
+struct ar {
+ int au[256];
+ f h(int);
+} bb;
+a i();
+a j(int);
+long k(int, ar);
+int d;
+void l(char *, ar m, long n) {
+ switch (m.au[d])
+ case 0:
+ n &= 4294967295;
+ bb.h(0).g(n);
+}
+void o() {
+ ar bd;
+ a bh, bi, attrname = j(0) = i();
+ int be = k(0, bd);
+ l(attrname.e(), bd, be);
+}

View File

@ -0,0 +1,27 @@
This backport contains 1 patch from gcc main stream tree.
The commit id of these patchs list as following in the order of time.
0001-PR92303-Try-to-simplify-memory-subreg.patch
a4504f32c056db781a2bdc104dffa1b29684c930
diff -uprN a/gcc/lra-spills.c b/gcc/lra-spills.c
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -421,7 +421,16 @@ remove_pseudos (rtx *loc, rtx_insn *insn)
if (*loc == NULL_RTX)
return res;
code = GET_CODE (*loc);
- if (code == REG && (i = REGNO (*loc)) >= FIRST_PSEUDO_REGISTER
+ if (code == SUBREG && REG_P (SUBREG_REG (*loc)))
+ {
+ /* Try to remove memory subregs to simplify LRA job
+ and avoid LRA cycling in case of subreg memory reload. */
+ res = remove_pseudos (&SUBREG_REG (*loc), insn);
+ if (GET_CODE (SUBREG_REG (*loc)) == MEM)
+ alter_subreg (loc, false);
+ return res;
+ }
+ else if (code == REG && (i = REGNO (*loc)) >= FIRST_PSEUDO_REGISTER
&& lra_get_regno_hard_regno (i) < 0
/* We do not want to assign memory for former scratches because
it might result in an address reload for some targets. In

View File

@ -1,4 +1,4 @@
%global DATE 20200522 %global DATE 20200629
%global gcc_version 9.3.1 %global gcc_version 9.3.1
%global gcc_major 9.3.1 %global gcc_major 9.3.1
@ -60,7 +60,7 @@
Summary: Various compilers (C, C++, Objective-C, ...) Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc Name: gcc
Version: %{gcc_version} Version: %{gcc_version}
Release: %{gcc_release}.2 Release: %{gcc_release}.3
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Source0: gcc-9.3.0.tar.xz Source0: gcc-9.3.0.tar.xz
%global isl_version 0.16.1 %global isl_version 0.16.1
@ -131,6 +131,9 @@ Patch15: fix-ICE-in-vectorizable-load.patch
Patch16: address-calculation-optimization-within-loop.patch Patch16: address-calculation-optimization-within-loop.patch
Patch17: skip-debug-insns-when-computing-inline-costs.patch Patch17: skip-debug-insns-when-computing-inline-costs.patch
Patch18: change-gcc-BASE-VER.patch Patch18: change-gcc-BASE-VER.patch
Patch19: PR92303-Try-to-simplify-memory-subreg.patch
Patch20: Fix-PR94185.patch
Patch21: testsuite-Fix-pr94185.patch
%global gcc_target_platform %{_arch}-linux-gnu %global gcc_target_platform %{_arch}-linux-gnu
@ -591,6 +594,9 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch16 -p1 %patch16 -p1
%patch17 -p1 %patch17 -p1
%patch18 -p1 %patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%build %build
@ -671,9 +677,9 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \
%endif %endif
%ifarch sparc sparcv9 sparc64 %ifarch sparc sparcv9 sparc64
make -j %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" bootstrap make -j32 BOOT_CFLAGS="$OPT_FLAGS" bootstrap
%else %else
make -j %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" BOOT_LDFLAGS="-pie -Wl,-z,relro,-z,now" make -j32 BOOT_CFLAGS="$OPT_FLAGS" BOOT_LDFLAGS="-pie -Wl,-z,relro,-z,now"
%endif %endif
# Make generated man pages even if Pod::Man is not new enough # Make generated man pages even if Pod::Man is not new enough
@ -1485,7 +1491,7 @@ cd obj-%{gcc_target_platform}
%if %{build_check} %if %{build_check}
# run the tests. # run the tests.
LC_ALL=C make -j %{?_smp_mflags} -k check ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ \ LC_ALL=C make -j32 -k check ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ \
RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'" || : RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'" || :
echo ====================TESTING========================= echo ====================TESTING=========================
( LC_ALL=C ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' ( LC_ALL=C ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}'
@ -2519,6 +2525,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog* %doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog %changelog
* Mon Jun 29 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200312.3
- PR92303-Try-to-simplify-memory-subreg.patch: New file, fix ICE
- Fix-PR94185.patch: Likewise
- testsuite-Fix-pr94185.patch: Likewise
- gcc.spec: Add new patch
* Fri May 22 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200312.2 * Fri May 22 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200312.2
- gcc.spec: Modify Release to %{release}.2 - gcc.spec: Modify Release to %{release}.2

View File

@ -0,0 +1,18 @@
This backport contains 1 patch from gcc main stream tree.
The commit id of these patchs list as following in the order of time.
0001-testsuite-Fix-pr94185.C-testcase-on-i686-linux-with-.patch
994d48620621fa33d32018be5fb70042e38546d5
diff -uprN a/gcc/testsuite/g++.target/i386/pr94185.C b/gcc/testsuite/g++.target/i386/pr94185.C
--- a/gcc/testsuite/g++.target/i386/pr94185.C
+++ b/gcc/testsuite/g++.target/i386/pr94185.C
@@ -22,7 +22,7 @@ int d;
void l(char *, ar m, long n) {
switch (m.au[d])
case 0:
- n &= 4294967295;
+ n &= 4294967295U;
bb.h(0).g(n);
}
void o() {