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:
parent
34e94db7ad
commit
31ceb57477
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user