diff --git a/Fix-PR94185.patch b/Fix-PR94185.patch new file mode 100644 index 0000000000000000000000000000000000000000..370ec0abbb49e8cddbe42e1af79372ceba4bc7b8 --- /dev/null +++ b/Fix-PR94185.patch @@ -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); ++} diff --git a/PR92303-Try-to-simplify-memory-subreg.patch b/PR92303-Try-to-simplify-memory-subreg.patch new file mode 100644 index 0000000000000000000000000000000000000000..31c1acd594a9600cf5098695d9f2bee02823486e --- /dev/null +++ b/PR92303-Try-to-simplify-memory-subreg.patch @@ -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 diff --git a/gcc.spec b/gcc.spec index cbc790e9ac8f433c3e0e5f4ad64079d35e08a420..7a20ad4ca3390c1fb92d45065e14d156c10169c5 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,4 +1,4 @@ -%global DATE 20200522 +%global DATE 20200629 %global gcc_version 9.3.1 %global gcc_major 9.3.1 @@ -60,7 +60,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc 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 Source0: gcc-9.3.0.tar.xz %global isl_version 0.16.1 @@ -131,6 +131,9 @@ Patch15: fix-ICE-in-vectorizable-load.patch Patch16: address-calculation-optimization-within-loop.patch Patch17: skip-debug-insns-when-computing-inline-costs.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 @@ -591,6 +594,9 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 %build @@ -671,9 +677,9 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %endif %ifarch sparc sparcv9 sparc64 -make -j %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" bootstrap +make -j32 BOOT_CFLAGS="$OPT_FLAGS" bootstrap %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 # Make generated man pages even if Pod::Man is not new enough @@ -1485,7 +1491,7 @@ cd obj-%{gcc_target_platform} %if %{build_check} # 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}'" || : echo ====================TESTING========================= ( 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* %changelog +* Mon Jun 29 2020 eastb233 - 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 - 9.3.1-20200312.2 - gcc.spec: Modify Release to %{release}.2 diff --git a/testsuite-Fix-pr94185.patch b/testsuite-Fix-pr94185.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4d4da218bcb60db3386de6c07521a926dd761e1 --- /dev/null +++ b/testsuite-Fix-pr94185.patch @@ -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() {