From 17bfb88a0e2711238bc0d58b824fb0e95322000d Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Thu, 11 Jul 2019 09:39:21 +0200
Subject: [PATCH 1/3] gcc: import upstream patch for bug 90756.

---
 srcpkgs/gcc/patches/bug90756.patch | 23 +++++++++++++++++++++++
 srcpkgs/gcc/template               |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/gcc/patches/bug90756.patch

diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
new file mode 100644
index 00000000000..cf78dad9cce
--- /dev/null
+++ b/srcpkgs/gcc/patches/bug90756.patch
@@ -0,0 +1,23 @@
+Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
+
+--- gcc/explow.c	2019/07/04 02:39:58	273035
++++ gcc/explow.c	2019/07/04 04:49:22	273036
+@@ -892,16 +892,7 @@
+ 
+   tree type = TREE_TYPE (name);
+   int unsignedp = TYPE_UNSIGNED (type);
+-  machine_mode mode = TYPE_MODE (type);
+-
+-  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
+-  if (mode == BLKmode)
+-    {
+-      gcc_assert (VECTOR_TYPE_P (type));
+-      mode = type->type_common.mode;
+-    }
+-
+-  machine_mode pmode = promote_mode (type, mode, &unsignedp);
++  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
+   if (punsignedp)
+     *punsignedp = unsignedp;
+ 
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index fcc150b5587..bebcba9ac3d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -8,7 +8,7 @@ _isl_version=0.19
 
 pkgname=gcc
 version=${_minorver}.0
-revision=2
+revision=3
 short_desc="GNU Compiler Collection"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="http://gcc.gnu.org"

From 158173ab637121d55109964fbeade1401a08229a Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Thu, 11 Jul 2019 09:39:56 +0200
Subject: [PATCH 2/3] cross-i686-linux-musl: import upstream patch for bug
 90756.

---
 srcpkgs/cross-i686-linux-musl/files/bug90756.patch | 1 +
 srcpkgs/cross-i686-linux-musl/template             | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
new file mode 120000
index 00000000000..02ae43b18b4
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
@@ -0,0 +1 @@
+../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 840e9c111ed..a2bbefd8817 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -11,7 +11,7 @@ _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=2
+revision=3
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -88,6 +88,7 @@ _gcc_bootstrap() {
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From f360a79ba95424dc8082a8cf798f19c47142a720 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Thu, 11 Jul 2019 09:40:25 +0200
Subject: [PATCH 3/3] cross-i686-pc-linux-gnu: import upstream patch for bug
 90756.

[ci skip]
---
 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch | 1 +
 srcpkgs/cross-i686-pc-linux-gnu/template             | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
new file mode 120000
index 00000000000..02ae43b18b4
--- /dev/null
+++ b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
@@ -0,0 +1 @@
+../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index bf4012f1aa9..2fb5de011dc 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -11,7 +11,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -83,6 +83,7 @@ _gcc_bootstrap() {
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
 	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
+	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
