Commit 91af9dc9 by Richard Guenther Committed by Richard Biener

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
parent 585d0dc4
2012-10-08 Richard Guenther <rguenther@suse.de> 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. * tree-ssa-pre.c (postorder_num): New global.
(compute_antic): Initialize all blocks and adjust for (compute_antic): Initialize all blocks and adjust for
generic postorder. generic postorder.
......
...@@ -3849,11 +3849,7 @@ compute_avail (void) ...@@ -3849,11 +3849,7 @@ compute_avail (void)
|| code == VEC_COND_EXPR) || code == VEC_COND_EXPR)
continue; continue;
vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1, vn_nary_op_lookup_stmt (stmt, &nary);
code,
gimple_expr_type (stmt),
gimple_assign_rhs1_ptr (stmt),
&nary);
if (!nary) if (!nary)
continue; continue;
......
...@@ -2194,6 +2194,9 @@ vn_nary_length_from_stmt (gimple stmt) ...@@ -2194,6 +2194,9 @@ vn_nary_length_from_stmt (gimple stmt)
case VIEW_CONVERT_EXPR: case VIEW_CONVERT_EXPR:
return 1; return 1;
case BIT_FIELD_REF:
return 3;
case CONSTRUCTOR: case CONSTRUCTOR:
return CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt)); return CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
...@@ -2220,6 +2223,13 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple 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); vno->op[0] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
break; 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: case CONSTRUCTOR:
vno->length = CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt)); vno->length = CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
for (i = 0; i < vno->length; ++i) for (i = 0; i < vno->length; ++i)
...@@ -2227,6 +2237,7 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt) ...@@ -2227,6 +2237,7 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
break; break;
default: default:
gcc_checking_assert (!gimple_assign_single_p (stmt));
vno->length = gimple_num_ops (stmt) - 1; vno->length = gimple_num_ops (stmt) - 1;
for (i = 0; i < vno->length; ++i) for (i = 0; i < vno->length; ++i)
vno->op[i] = gimple_op (stmt, i + 1); vno->op[i] = gimple_op (stmt, i + 1);
......
...@@ -51,7 +51,7 @@ typedef const struct vn_nary_op_s *const_vn_nary_op_t; ...@@ -51,7 +51,7 @@ typedef const struct vn_nary_op_s *const_vn_nary_op_t;
static inline size_t static inline size_t
sizeof_vn_nary_op (unsigned int length) 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 /* Phi nodes in the hashtable consist of their non-VN_TOP phi
......
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