From f5fd577303c2de348a58a499d6957045a40e8c96 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Wed, 25 Feb 2015 19:21:37 +0100 Subject: [PATCH] re PR tree-optimization/61917 (ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913) PR tree-optimization/61917 * tree-vect-loop.c (vectorizable_reduction): Handle obvious case that reduc_def_stmt is null. From-SVN: r220987 --- gcc/ChangeLog | 6 ++++++ gcc/tree-vect-loop.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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 -- 2.30.2