Commit c245362b by Ilya Enkovich Committed by Ilya Enkovich

re PR tree-optimization/68327 (ICE on valid code at -O3 on x86_64-linux-gnu in…

re PR tree-optimization/68327 (ICE on valid code at -O3 on x86_64-linux-gnu in vect_is_simple_use, at tree-vect-stmts.c:8562)

gcc/

	PR tree-optimization/68327
	* tree-vect-loop.c (vect_determine_vectorization_factor): Don't
	compute vectype for non-relevant mask producers.
	* gcc/tree-vect-stmts.c (vectorizable_comparison): Check stmt
	relevance earlier.

gcc/testsuite/

	PR tree-optimization/68327
	* gcc.dg/pr68327.c: New test.


Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r230743
parent 1cabb204
2015-11-23 Ilya Enkovich <enkovich.gnu@gmail.com>
Richard Biener <rguenther@suse.de>
PR tree-optimization/68327
* tree-vect-loop.c (vect_determine_vectorization_factor): Don't
compute vectype for non-relevant mask producers.
* gcc/tree-vect-stmts.c (vectorizable_comparison): Check stmt
relevance earlier.
2015-11-23 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68460
2015-11-23 Ilya Enkovich <enkovich.gnu@gmail.com>
PR tree-optimization/68327
* gcc.dg/pr68327.c: New test.
2015-11-23 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68460
......
/* { dg-do compile } */
/* { dg-options "-O3" } */
int a, d;
char b, c;
void
fn1 ()
{
int i = 0;
for (; i < 1; i++)
d = 1;
for (; b; b++)
a = 1 && (d & b);
}
......@@ -439,7 +439,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
compute a factor. */
if (TREE_CODE (scalar_type) == BOOLEAN_TYPE)
{
mask_producers.safe_push (stmt_info);
if (STMT_VINFO_RELEVANT_P (stmt_info))
mask_producers.safe_push (stmt_info);
bool_result = true;
if (gimple_code (stmt) == GIMPLE_ASSIGN
......
......@@ -7590,6 +7590,9 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
tree mask_type;
tree mask;
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (!VECTOR_BOOLEAN_TYPE_P (vectype))
return false;
......@@ -7602,9 +7605,6 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& !(STMT_VINFO_DEF_TYPE (stmt_info) == vect_nested_cycle
&& reduc_def))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment