aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-07-21 11:32:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-07-21 11:32:01 +0000
commit9af7f3731b0ddffb3aa75b78a0ede411d36a3b09 (patch)
treee717addc450ca3667b9854cfe21f2530cd0b9686 /gcc
parent8c38aed722cbd17db8bcab50087acb9e40493c73 (diff)
downloadgcc-9af7f3731b0ddffb3aa75b78a0ede411d36a3b09.zip
gcc-9af7f3731b0ddffb3aa75b78a0ede411d36a3b09.tar.gz
gcc-9af7f3731b0ddffb3aa75b78a0ede411d36a3b09.tar.bz2
re PR tree-optimization/81500 (ICE with -O3 in process_use, at tree-vect-stmts.c:506)
2017-06-21 Richard Biener <rguenther@suse.de> PR tree-optimization/81500 * tree-vect-loop.c (vect_is_simple_reduction): Properly fail if we didn't identify a reduction path. * gcc.dg/torture/pr81500.c: New testcase. From-SVN: r250423
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr81500.c13
-rw-r--r--gcc/tree-vect-loop.c6
4 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a2bc6e7..59d59b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81500
+ * tree-vect-loop.c (vect_is_simple_reduction): Properly fail if
+ we didn't identify a reduction path.
+
2017-07-21 Tom de Vries <tom@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 482b8dd..148bb42 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81500
+ * gcc.dg/torture/pr81500.c: New testcase.
+
2017-07-20 Nathan Sidwell <nathan@acm.org>
* g++.dg/ext/anon-struct6.C: Adjust diag.
diff --git a/gcc/testsuite/gcc.dg/torture/pr81500.c b/gcc/testsuite/gcc.dg/torture/pr81500.c
new file mode 100644
index 0000000..7aaec21
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr81500.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+typedef int a;
+void c(int *b)
+{
+ int d;
+ a e, f, *g, *h = b;
+ for (; d; d--) {
+ f = *g & 1;
+ *h-- = *g-- | e;
+ e = f;
+ }
+}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 64d8699..931f1b5 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3243,7 +3243,7 @@ pop:
}
/* Check whether the reduction path detected is valid. */
- bool fail = false;
+ bool fail = path.length () == 0;
bool neg = false;
for (unsigned i = 1; i < path.length (); ++i)
{
@@ -3276,9 +3276,7 @@ pop:
if (dump_enabled_p ())
{
- report_vect_op (MSG_MISSED_OPTIMIZATION,
- SSA_NAME_DEF_STMT
- (USE_FROM_PTR (path[path.length ()-1].second)),
+ report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt,
"reduction: unknown pattern: ");
}