Commit 9ef7adc0 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/53693 (ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438)

2012-06-18  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/53693
	* tree-vect-patterns.c (vect_operation_fits_smaller_type):
	Reject operands with more than one use.

	* g++.dg/torture/pr53693.C: New testcase.

From-SVN: r188733
parent 9b10be32
2012-06-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53693
* tree-vect-patterns.c (vect_operation_fits_smaller_type):
Reject operands with more than one use.
2012-06-18 Bill Schmidt <wschmidt@linux.ibm.com> 2012-06-18 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/53703 PR tree-optimization/53703
......
2012-06-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53693
* g++.dg/torture/pr53693.C: New testcase.
2012-06-18 Bill Schmidt <wschmidt@linux.ibm.com> 2012-06-18 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/53703 PR tree-optimization/53703
......
// { dg-do compile }
void
filter_scanlines (void *src_buffer, void *dst_buffer, int dst_pitch, int width)
{
int x;
unsigned short *src, *dst_a, *dst_b;
src = (unsigned short *) src_buffer;
dst_a = (unsigned short *) dst_buffer;
dst_b = ((unsigned short *) dst_buffer) + (dst_pitch >> 1);
for (x = 0; x < width; x++)
{
unsigned char gs, gh;
gs = src[x];
gh = gs + (gs >> 1);
dst_a[x] = (gh << 5) | (gh);
dst_b[x] = ((gs - gh) << 5) | (gs - gh);
}
}
...@@ -991,6 +991,11 @@ vect_operation_fits_smaller_type (gimple stmt, tree def, tree *new_type, ...@@ -991,6 +991,11 @@ vect_operation_fits_smaller_type (gimple stmt, tree def, tree *new_type,
|| TREE_CODE (const_oprnd) != INTEGER_CST) || TREE_CODE (const_oprnd) != INTEGER_CST)
return false; return false;
/* If oprnd has other uses besides that in stmt we cannot mark it
as being part of a pattern only. */
if (!has_single_use (oprnd))
return false;
/* If we are in the middle of a sequence, we use DEF from a previous /* If we are in the middle of a sequence, we use DEF from a previous
statement. Otherwise, OPRND has to be a result of type promotion. */ statement. Otherwise, OPRND has to be a result of type promotion. */
if (*new_type) if (*new_type)
......
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