diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d231c3a5ba..ec2cb695cf7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-25 Kai Tietz + + PR tree-optimization/61917 + * tree-vect-loop.c (vectorizable_reduction): Handle obvious case + that reduc_def_stmt is null. + 2015-02-25 Martin Liska * ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 5a151fc1859..dd4ada2d09d 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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