re PR tree-optimization/32216 (ICE: verify_stmts failed (invalid reference prefix) with -ftree-vectorize)

PR tree-optimization/32216
	* tree-vectorizer.c (supportable_widening_operation): Determine
	signedness of FIX_TRUNC_EXPR from output operand.
	(supportable_narrowing_operation): Ditto.
	* tree-vect-generic.c (expand_vector_operations_1): Determine
	signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
	from input operand.

testsuite/ChangeLog:
	
	PR tree-optimization/32216
	* gcc.dg/vect/pr32216.c: New test.

From-SVN: r125482
This commit is contained in:
Uros Bizjak 2007-06-06 14:12:32 +02:00
parent ec11296fef
commit 9f106823dc
6 changed files with 59 additions and 11 deletions

View file

@ -1,8 +1,18 @@
2007-06-06 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/32216
* tree-vectorizer.c (supportable_widening_operation): Determine
signedness of FIX_TRUNC_EXPR from output operand.
(supportable_narrowing_operation): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Determine
signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
from input operand.
2007-06-06 Thomas Neumann <tneumann@users.sourceforge.net>
* config/i386/i386.c (enum pta_flags): Move out of struct scope...
(struct pta): ...from here. Change flags to unsigned to avoid excessive
casting (as it is used as a bit mask).
(struct pta): ...from here. Change flags to unsigned to avoid
excessive casting (as it is used as a bit mask).
(override_options): Add casts according to the coding convenventions.
(x86_64_elf_unique_section): Likewise.
(examine_argument): Avoid using C++ keywords as variable names.

View file

@ -357,6 +357,7 @@ optab_for_tree_code (enum tree_code code, tree type)
return TYPE_UNSIGNED (type) ? vec_pack_usat_optab : vec_pack_ssat_optab;
case VEC_PACK_FIX_TRUNC_EXPR:
/* The signedness is determined from output operand. */
return TYPE_UNSIGNED (type) ?
vec_pack_ufix_trunc_optab : vec_pack_sfix_trunc_optab;

View file

@ -1,3 +1,8 @@
2007-06-06 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/32216
* gcc.dg/vect/pr32216.c: New test.
2007-06-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR testsuite/18923

View file

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_floatint_cvt } */
unsigned int wlookup2[203];
SetSoundVariables (int x)
{
for (x = 1; x < 32; x++)
{
wlookup2[x] = (double) 16 / x;
}
}
/* { dg-final { cleanup-tree-dump "vect" } } */

View file

@ -412,17 +412,22 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
return;
gcc_assert (code != CONVERT_EXPR);
/* The signedness is determined from input argument. */
if (code == VEC_UNPACK_FLOAT_HI_EXPR
|| code == VEC_UNPACK_FLOAT_LO_EXPR)
type = TREE_TYPE (TREE_OPERAND (rhs, 0));
op = optab_for_tree_code (code, type);
/* For widening/narrowing vector operations, the relevant type is of the
arguments, not the widened result. */
arguments, not the widened result. VEC_UNPACK_FLOAT_*_EXPR is
calculated in the same way above. */
if (code == WIDEN_SUM_EXPR
|| code == VEC_WIDEN_MULT_HI_EXPR
|| code == VEC_WIDEN_MULT_LO_EXPR
|| code == VEC_UNPACK_HI_EXPR
|| code == VEC_UNPACK_LO_EXPR
|| code == VEC_UNPACK_FLOAT_HI_EXPR
|| code == VEC_UNPACK_FLOAT_LO_EXPR
|| code == VEC_PACK_TRUNC_EXPR
|| code == VEC_PACK_SAT_EXPR
|| code == VEC_PACK_FIX_TRUNC_EXPR)

View file

@ -1851,10 +1851,17 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
gcc_unreachable ();
}
*code1 = c1;
*code2 = c2;
optab1 = optab_for_tree_code (c1, vectype);
optab2 = optab_for_tree_code (c2, vectype);
if (code == FIX_TRUNC_EXPR)
{
/* The signedness is determined from output operand. */
optab1 = optab_for_tree_code (c1, type);
optab2 = optab_for_tree_code (c2, type);
}
else
{
optab1 = optab_for_tree_code (c1, vectype);
optab2 = optab_for_tree_code (c2, vectype);
}
if (!optab1 || !optab2)
return false;
@ -1867,6 +1874,8 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
|| insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
return false;
*code1 = c1;
*code2 = c2;
return true;
}
@ -1918,8 +1927,11 @@ supportable_narrowing_operation (enum tree_code code,
gcc_unreachable ();
}
*code1 = c1;
optab1 = optab_for_tree_code (c1, vectype);
if (code == FIX_TRUNC_EXPR)
/* The signedness is determined from output operand. */
optab1 = optab_for_tree_code (c1, type);
else
optab1 = optab_for_tree_code (c1, vectype);
if (!optab1)
return false;
@ -1929,6 +1941,7 @@ supportable_narrowing_operation (enum tree_code code,
|| insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
return false;
*code1 = c1;
return true;
}