From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1062784-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 7F2D9138334
	for <garchives@archives.gentoo.org>; Tue, 18 Dec 2018 22:39:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5F099E097D;
	Tue, 18 Dec 2018 22:39:03 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 1DF49E097D
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Dec 2018 22:39:02 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id B281F335C3D
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Dec 2018 22:39:00 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id DB46A326
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Dec 2018 22:38:58 +0000 (UTC)
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" <slyfox@gentoo.org>
Message-ID: <1545172645.134dc72e3b4e140756f00b65688f084188f59d18.slyfox@gentoo>
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 8.2.0/gentoo/
X-VCS-Repository: proj/gcc-patches
X-VCS-Files: 8.2.0/gentoo/115_all_avx2-SIGSEGV-PR86871.patch 8.2.0/gentoo/README.history
X-VCS-Directories: 8.2.0/gentoo/
X-VCS-Committer: slyfox
X-VCS-Committer-Name: Sergei Trofimovich
X-VCS-Revision: 134dc72e3b4e140756f00b65688f084188f59d18
X-VCS-Branch: master
Date: Tue, 18 Dec 2018 22:38:58 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 9f1eb8bd-9e37-4817-bcd2-5b572f998c3f
X-Archives-Hash: e22b242a6f30fe43d3ad9d69956207e0

commit:     134dc72e3b4e140756f00b65688f084188f59d18
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 18 22:37:25 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Dec 18 22:37:25 2018 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=134dc72e

8.2.0: backport avx2 codegen SIGSEGV, bug #657060

Fixes SIGSEGV when building media-libs/opencv-3.4.1-r1

Reported-by: Johannes Hirte
Bug: https://bugs.gentoo.org/657060
Bug: https://gcc.gnu.org/PR86871
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 8.2.0/gentoo/115_all_avx2-SIGSEGV-PR86871.patch | 69 +++++++++++++++++++++++++
 8.2.0/gentoo/README.history                     |  1 +
 2 files changed, 70 insertions(+)

diff --git a/8.2.0/gentoo/115_all_avx2-SIGSEGV-PR86871.patch b/8.2.0/gentoo/115_all_avx2-SIGSEGV-PR86871.patch
new file mode 100644
index 0000000..4d24259
--- /dev/null
+++ b/8.2.0/gentoo/115_all_avx2-SIGSEGV-PR86871.patch
@@ -0,0 +1,69 @@
+https://bugs.gentoo.org/657060
+https://gcc.gnu.org/PR86871
+
+From c69949a7ec14a363128cd1445c7153e1ce051eb7 Mon Sep 17 00:00:00 2001
+From: rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 14 Aug 2018 09:24:45 +0000
+Subject: [PATCH] Fix invalid assumption in vect_transform_stmt (PR 86871)
+
+The handling of outer-loop uses of inner-loop definitions assumed
+that anything that wasn't a PHI would be a gassign.  It's also
+possible for it to be a gcall.
+
+2018-08-14  Richard Sandiford  <richard.sandiford@arm.com>
+
+gcc/
+	Backport from mainline
+	2018-08-09  Richard Sandiford  <richard.sandiford@arm.com>
+
+	PR tree-optimization/86871
+	* tree-vect-stmts.c (vect_transform_stmt): Use gimple_get_lhs
+	instead of gimple_assign_lhs.
+
+gcc/testsuite/
+	Backport from mainline
+	2018-08-09  Richard Sandiford  <richard.sandiford@arm.com>
+
+	PR tree-optimization/86871
+	* gcc.dg/vect/pr86871.c: New test.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@263528 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/testsuite/gcc.dg/vect/pr86871.c | 15 +++++++++++++++
+ gcc/tree-vect-stmts.c               |  2 +-
+ 4 files changed, 33 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.dg/vect/pr86871.c
+
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/vect/pr86871.c
+@@ -0,0 +1,15 @@
++/* { dg-do compile } */
++
++extern int b[];
++extern int c[];
++void g(int f) {
++  for (; f; f++) {
++    int d = 0;
++    for (int e = -1; e <= 1; e++) {
++      int a = f + e;
++      if (a)
++        d = *(c + a);
++    }
++    *(b + f) = d;
++  }
++ }
+--- a/gcc/tree-vect-stmts.c
++++ b/gcc/tree-vect-stmts.c
+@@ -9602,7 +9602,7 @@ vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
+       if (gimple_code (stmt) == GIMPLE_PHI)
+         scalar_dest = PHI_RESULT (stmt);
+       else
+-        scalar_dest = gimple_assign_lhs (stmt);
++        scalar_dest = gimple_get_lhs (stmt);
+ 
+       FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
+        {
+-- 
+2.20.1
+

diff --git a/8.2.0/gentoo/README.history b/8.2.0/gentoo/README.history
index 787f60c..6e3896c 100644
--- a/8.2.0/gentoo/README.history
+++ b/8.2.0/gentoo/README.history
@@ -1,5 +1,6 @@
 1.7		TODO
 	+ 114_all_kr-decl-PR88214.patch
+	+ 115_all_avx2-SIGSEGV-PR86871.patch
 
 1.6		01 Dec 2018
 	U 10_all_default-fortify-source.patch