]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/81500 (ICE with -O3 in process_use, at tree-vect-stmts.c...
authorRichard Biener <rguenther@suse.de>
Fri, 21 Jul 2017 11:32:01 +0000 (11:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 21 Jul 2017 11:32:01 +0000 (11:32 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr81500.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index a2bc6e7a6c4b2c330d71f866aa4e520d80444808..59d59b815e06dee5e2c7e241696c7fc94ce6ba38 100644 (file)
@@ -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>
 
index 482b8dd2c9a12dacb3c19eb09973e4279ece1ebd..148bb429f713674bd2b82044a335bde138e93d37 100644 (file)
@@ -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 (file)
index 0000000..7aaec21
--- /dev/null
@@ -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;
+  }
+}
index 64d86995c84ea9a8875e5bdfd0a662fba85e2edd..931f1b5872e6820b5b85d4e9c1ef9c5b9b8b2e5d 100644 (file)
@@ -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: ");
     }