Commit 842679dc by Tom de Vries Committed by Tom de Vries

re PR tree-optimization/51990 (ICE in copy_reference_ops_from_ref)

2012-01-27  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/51990
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle WITH_SIZE_EXPR.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Same.

From-SVN: r183614
parent 4daa71b0
2012-01-27 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51990
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle WITH_SIZE_EXPR.
* tree-ssa-pre.c (create_component_ref_by_pieces_1): Same.
2012-01-27 Jakub Jelinek <jakub@redhat.com> 2012-01-27 Jakub Jelinek <jakub@redhat.com>
PR debug/52001 PR debug/52001
......
...@@ -2792,6 +2792,23 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref, ...@@ -2792,6 +2792,23 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
return folded; return folded;
} }
break; break;
case WITH_SIZE_EXPR:
{
tree genop0 = create_component_ref_by_pieces_1 (block, ref, operand,
stmts, domstmt);
pre_expr op1expr = get_or_alloc_expr_for (currop->op0);
tree genop1;
if (!genop0)
return NULL_TREE;
genop1 = find_or_generate_expression (block, op1expr, stmts, domstmt);
if (!genop1)
return NULL_TREE;
return fold_build2 (currop->opcode, currop->type, genop0, genop1);
}
break;
case BIT_FIELD_REF: case BIT_FIELD_REF:
{ {
tree folded; tree folded;
......
...@@ -628,6 +628,10 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result) ...@@ -628,6 +628,10 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
switch (temp.opcode) switch (temp.opcode)
{ {
case WITH_SIZE_EXPR:
temp.op0 = TREE_OPERAND (ref, 1);
temp.off = 0;
break;
case MEM_REF: case MEM_REF:
/* The base address gets its own vn_reference_op_s structure. */ /* The base address gets its own vn_reference_op_s structure. */
temp.op0 = TREE_OPERAND (ref, 1); temp.op0 = TREE_OPERAND (ref, 1);
...@@ -744,6 +748,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result) ...@@ -744,6 +748,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
VEC_safe_push (vn_reference_op_s, heap, *result, &temp); VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
if (REFERENCE_CLASS_P (ref) if (REFERENCE_CLASS_P (ref)
|| TREE_CODE (ref) == WITH_SIZE_EXPR
|| (TREE_CODE (ref) == ADDR_EXPR || (TREE_CODE (ref) == ADDR_EXPR
&& !is_gimple_min_invariant (ref))) && !is_gimple_min_invariant (ref)))
ref = TREE_OPERAND (ref, 0); ref = TREE_OPERAND (ref, 0);
......
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