+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.
|| 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;
case VIEW_CONVERT_EXPR:
return 1;
+ case BIT_FIELD_REF:
+ return 3;
+
case CONSTRUCTOR:
return CONSTRUCTOR_NELTS (gimple_assign_rhs1 (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)
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);
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