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)

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
This commit is contained in:
Richard Biener 2015-02-25 13:36:00 +00:00 committed by Kai Tietz
parent 94ba1bd56a
commit 3d9bab5a54
2 changed files with 13 additions and 3 deletions

View 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

View 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,