re PR tree-optimization/61917 (ICE on valid code at -O3 on x86_64-linux-gnu in vector...
authorRichard Biener <rguenther@suse.de>
Wed, 25 Feb 2015 13:36:00 +0000 (13:36 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Wed, 25 Feb 2015 13:36:00 +0000 (14:36 +0100)
2015-02-25  Richard Biener  <rguenther@suse.de>
Kai Tietz  <ktietz@redhat.com>

PR tree-optimization/61917
* tree-vect-loop.c (vectorizable_reduction): Allow
vect_internal_def without reduction to exit graceful.

Co-Authored-By: Kai Tietz <ktietz@redhat.com>
From-SVN: r220966

gcc/ChangeLog
gcc/tree-vect-loop.c

index e6034118729a93bea24168507f5ea5b58866cdfe..d4304cd71ea4c60792d0701bd1a3f30f04db8bf1 100644 (file)
@@ -1,3 +1,10 @@
+2015-02-25  Richard Biener  <rguenther@suse.de>
+       Kai Tietz  <ktietz@redhat.com>
+
+       PR tree-optimization/61917
+       * tree-vect-loop.c (vectorizable_reduction): Allow
+       vect_internal_def without reduction to exit graceful.
+
 2015-02-25  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/65196
index 3e7c701e636b685d21ac2561348c98707350338f..5a151fc1859ffca517b6845a9cecb8e41dd768e2 100644 (file)
@@ -4981,6 +4981,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
   if (!vectype_in)
     vectype_in = tem;
   gcc_assert (is_simple_use);
+  if (!found_nested_cycle_def)
+    reduc_def_stmt = def_stmt;
+
+  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
+    return false;
+
   if (!(dt == vect_reduction_def
        || dt == vect_nested_cycle
        || ((dt == vect_internal_def || dt == vect_external_def
@@ -4993,10 +4999,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
       gcc_assert (orig_stmt);
       return false;
     }
-  if (!found_nested_cycle_def)
-    reduc_def_stmt = def_stmt;
 
-  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
   if (orig_stmt)
     gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
                                                        reduc_def_stmt,