commit:     066e26c95928de295cf822034de2d2cd05acf8af
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  6 19:19:13 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Feb  6 19:19:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=066e26c9

sys-devel/gcc: allow negative insn cost, bug #707958

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 <AT> gentoo.org>

 sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch | 29 +++++++++++++++++++++++
 sys-devel/gcc/gcc-9.2.0-r2.ebuild                 |  7 +++++-
 sys-devel/gcc/gcc-9.2.0-r3.ebuild                 |  9 ++++++-
 3 files changed, 43 insertions(+), 2 deletions(-)

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
index 00000000000..7a6bebdf490
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch
@@ -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 <[email protected]>
+
+       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
+

diff --git a/sys-devel/gcc/gcc-9.2.0-r2.ebuild 
b/sys-devel/gcc/gcc-9.2.0-r2.ebuild
index e2638f44d60..97327a27655 100644
--- a/sys-devel/gcc/gcc-9.2.0-r2.ebuild
+++ b/sys-devel/gcc/gcc-9.2.0-r2.ebuild
@@ -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
+}

diff --git a/sys-devel/gcc/gcc-9.2.0-r3.ebuild 
b/sys-devel/gcc/gcc-9.2.0-r3.ebuild
index 107ecc45981..398613c13be 100644
--- a/sys-devel/gcc/gcc-9.2.0-r3.ebuild
+++ b/sys-devel/gcc/gcc-9.2.0-r3.ebuild
@@ -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
+}

Reply via email to