re PR tree-optimization/61917 (ICE on valid code at -O3 on x86_64-linux-gnu in vector...
authorKai Tietz <ktietz@redhat.com>
Wed, 25 Feb 2015 18:21:37 +0000 (19:21 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Wed, 25 Feb 2015 18:21:37 +0000 (19:21 +0100)
PR tree-optimization/61917
* tree-vect-loop.c (vectorizable_reduction): Handle obvious case
that reduc_def_stmt is null.

From-SVN: r220987

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

index 4d231c3a5ba7b456106d576939680087f90420d6..ec2cb695cf7501371620ed26d0b0d63aaf7b81fa 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-25  Kai Tietz  <ktietz@redhat.com>
+
+       PR tree-optimization/61917
+       * tree-vect-loop.c (vectorizable_reduction): Handle obvious case
+       that reduc_def_stmt is null.
+
 2015-02-25  Martin Liska  <mliska@suse.cz>
 
        * ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare
index 5a151fc1859ffca517b6845a9cecb8e41dd768e2..dd4ada2d09d0e6eec0c1a3cf96407adff8b9d934 100644 (file)
@@ -4984,7 +4984,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
   if (!found_nested_cycle_def)
     reduc_def_stmt = def_stmt;
 
-  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
+  if (reduc_def_stmt && gimple_code (reduc_def_stmt) != GIMPLE_PHI)
     return false;
 
   if (!(dt == vect_reduction_def