gimple.h (gimple_call_set_chain): Accept SSA variables.

* gimple.h (gimple_call_set_chain): Accept SSA variables.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1) <CALL_EXPR>:
	Rematerialize the static chain, if any.
	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Also copy the
	static chain.

From-SVN: r139072
This commit is contained in:
Eric Botcazou 2008-08-13 19:38:39 +00:00 committed by Eric Botcazou
parent 70a1c2f959
commit 7aec7a38d7
4 changed files with 20 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2008-08-13 Eric Botcazou <ebotcazou@adacore.com>
* gimple.h (gimple_call_set_chain): Accept SSA variables.
* tree-ssa-pre.c (create_component_ref_by_pieces_1) <CALL_EXPR>:
Rematerialize the static chain, if any.
* tree-ssa-sccvn.c (copy_reference_ops_from_call): Also copy the
static chain.
2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2out.c (dwarf_stack_op_name): Remove prototype.

View file

@ -2013,7 +2013,7 @@ gimple_call_set_chain (gimple gs, tree chain)
GIMPLE_CHECK (gs, GIMPLE_CALL);
gcc_assert (chain == NULL
|| TREE_CODE (chain) == ADDR_EXPR
|| DECL_P (chain));
|| SSA_VAR_P (chain));
gimple_set_op (gs, 2, chain);
}

View file

@ -2436,7 +2436,7 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
{
case CALL_EXPR:
{
tree folded;
tree folded, sc = currop->op1;
unsigned int nargs = 0;
tree *args = XNEWVEC (tree, VEC_length (vn_reference_op_s,
ref->operands) - 1);
@ -2453,6 +2453,14 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
: currop->op0,
nargs, args);
free (args);
if (sc)
{
pre_expr scexpr = get_or_alloc_expr_for (sc);
sc = find_or_generate_expression (block, scexpr, stmts, domstmt);
if (!sc)
return NULL_TREE;
CALL_EXPR_STATIC_CHAIN (folded) = sc;
}
return folded;
}
break;

View file

@ -686,12 +686,12 @@ copy_reference_ops_from_call (gimple call,
vn_reference_op_s temp;
unsigned i;
/* Copy the call_expr opcode, type, function being called, and
arguments. */
/* Copy the type, opcode, function being called and static chain. */
memset (&temp, 0, sizeof (temp));
temp.type = gimple_call_return_type (call);
temp.opcode = CALL_EXPR;
temp.op0 = gimple_call_fn (call);
temp.op1 = gimple_call_chain (call);
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
/* Copy the call arguments. As they can be references as well,
@ -701,7 +701,6 @@ copy_reference_ops_from_call (gimple call,
tree callarg = gimple_call_arg (call, i);
copy_reference_ops_from_ref (callarg, result);
}
return;
}
/* Create a vector of vn_reference_op_s structures from REF, a