Commit 31ceb574 by Jan Hubicka Committed by Jan Hubicka

tree-ssa-ccp.c (ccp_fold_stmt): Fold away OBJ_TYPE_REF when call destination is known.

	* tree-ssa-ccp.c (ccp_fold_stmt): Fold away OBJ_TYPE_REF when
	call destination is known.

From-SVN: r164908
parent 34e94db7
2010-10-02 Jan Hubicka <jh@suse.cz>
* tree-ssa-ccp.c (ccp_fold_stmt): Fold away OBJ_TYPE_REF when
call destination is known.
2010-10-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/45820
......@@ -2307,6 +2307,17 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
changed = true;
}
}
if (TREE_CODE (gimple_call_fn (stmt)) == OBJ_TYPE_REF)
{
tree expr = OBJ_TYPE_REF_EXPR (gimple_call_fn (stmt));
expr = valueize_op (expr);
if (TREE_CODE (expr) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL)
{
gimple_call_set_fn (stmt, expr);
changed = true;
}
}
return changed;
}
......
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