re PR tree-optimization/54825 (ICE with vector extension)

2012-10-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/54825
	* tree-ssa-sccvn.c (vn_nary_length_from_stmt): Handle BIT_FIELD_REF.
	(init_vn_nary_op_from_stmt): Likewise.
	* tree-ssa-pre.c (compute_avail): Use vn_nary_op_lookup_stmt.
	* tree-ssa-sccvn.h (sizeof_vn_nary_op): Avoid overflow.

From-SVN: r192205
This commit is contained in:
Richard Guenther 2012-10-08 11:58:03 +00:00 committed by Richard Biener
parent 585d0dc43c
commit 91af9dc984
4 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2012-10-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54825
* tree-ssa-sccvn.c (vn_nary_length_from_stmt): Handle BIT_FIELD_REF.
(init_vn_nary_op_from_stmt): Likewise.
* tree-ssa-pre.c (compute_avail): Use vn_nary_op_lookup_stmt.
* tree-ssa-sccvn.h (sizeof_vn_nary_op): Avoid overflow.
2012-10-08 Richard Guenther <rguenther@suse.de>
* tree-ssa-pre.c (postorder_num): New global.

View File

@ -3849,11 +3849,7 @@ compute_avail (void)
|| code == VEC_COND_EXPR)
continue;
vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1,
code,
gimple_expr_type (stmt),
gimple_assign_rhs1_ptr (stmt),
&nary);
vn_nary_op_lookup_stmt (stmt, &nary);
if (!nary)
continue;

View File

@ -2194,6 +2194,9 @@ vn_nary_length_from_stmt (gimple stmt)
case VIEW_CONVERT_EXPR:
return 1;
case BIT_FIELD_REF:
return 3;
case CONSTRUCTOR:
return CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
@ -2220,6 +2223,13 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
vno->op[0] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
break;
case BIT_FIELD_REF:
vno->length = 3;
vno->op[0] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
vno->op[1] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 1);
vno->op[2] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 2);
break;
case CONSTRUCTOR:
vno->length = CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
for (i = 0; i < vno->length; ++i)
@ -2227,6 +2237,7 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
break;
default:
gcc_checking_assert (!gimple_assign_single_p (stmt));
vno->length = gimple_num_ops (stmt) - 1;
for (i = 0; i < vno->length; ++i)
vno->op[i] = gimple_op (stmt, i + 1);

View File

@ -51,7 +51,7 @@ typedef const struct vn_nary_op_s *const_vn_nary_op_t;
static inline size_t
sizeof_vn_nary_op (unsigned int length)
{
return sizeof (struct vn_nary_op_s) + sizeof (tree) * (length - 1);
return sizeof (struct vn_nary_op_s) + sizeof (tree) * length - sizeof (tree);
}
/* Phi nodes in the hashtable consist of their non-VN_TOP phi