sys-devel/gcc: allow negative insn cost, bug #707958
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 6 Feb 2020 19:19:13 +0000 (19:19 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Thu, 6 Feb 2020 19:19:30 +0000 (19:19 +0000)
Apply the patch right on stable ebuild to unblock catalyst builds for ia64.

Reported-by: Matt Turner
Bug: https://bugs.gentoo.org/707958
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch [new file with mode: 0644]
sys-devel/gcc/gcc-9.2.0-r2.ebuild
sys-devel/gcc/gcc-9.2.0-r3.ebuild

diff --git a/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch b/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch
new file mode 100644 (file)
index 0000000..7a6bebd
--- /dev/null
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/707958
+https://gcc.gnu.org/PR88879
+
+Subject: [PATCH] sel-sched: allow negative insn priority (PR 88879)
+From: Alexander Monakov <amonakov@ispras.ru>
+
+       PR rtl-optimization/88879
+       * sel-sched.c (sel_target_adjust_priority): Remove assert.
+
+From-SVN: r271039
+---
+ gcc/ChangeLog   | 5 +++++
+ gcc/sel-sched.c | 2 --
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+--- a/gcc/sel-sched.c
++++ b/gcc/sel-sched.c
+@@ -3331,8 +3331,6 @@ sel_target_adjust_priority (expr_t expr)
+   else
+     new_priority = priority;
+-  gcc_assert (new_priority >= 0);
+-
+   /* If the priority has changed, adjust EXPR_PRIORITY_ADJ accordingly.  */
+   EXPR_PRIORITY_ADJ (expr) = new_priority - EXPR_PRIORITY (expr);
+-- 
+2.25.0
+
index e2638f44d602da2c82055f3a744dfc2eb1dd4003..97327a276552c3f60f3a8e1a000e91792ca29f17 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
@@ -17,3 +17,8 @@ DEPEND="${RDEPEND}
 if [[ ${CATEGORY} != cross-* ]] ; then
        PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
 fi
+
+src_prepare() {
+       toolchain_src_prepare
+       eapply "${FILESDIR}"/${PN}-9.2.0-neg-insn-cost.patch
+}
index 107ecc45981bcbb49ddf2ed36fd9285d98d526b8..398613c13beee9159a5c0fa470e9551759da272e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
@@ -14,6 +14,13 @@ DEPEND="${RDEPEND}
        elibc_glibc? ( >=sys-libs/glibc-2.13 )
        >=${CATEGORY}/binutils-2.20"
 
+PATCHES=("${FILESDIR}"/${PN}-9.2.0-neg-insn-cost.patch)
+
 if [[ ${CATEGORY} != cross-* ]] ; then
        PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
 fi
+
+src_prepare() {
+       toolchain_src_prepare
+       eapply "${FILESDIR}"/${PN}-9.2.0-neg-insn-cost.patch
+}