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
This commit is contained in:
Jan Hubicka 2010-10-03 00:03:18 +02:00 committed by Jan Hubicka
parent 34e94db7ad
commit 31ceb57477
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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;
}