summaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-29 09:36:36 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-29 09:36:36 +0000
commit722b598302cbaebca0283a57a29bc48043f18678 (patch)
tree281f5b739d6f8a6c8ed7eeab2bbcfd90eb80502d /gcc/gimple-fold.c
parent280faacf891517978e8c386bb808e8790702dbab (diff)
downloadgcc-722b598302cbaebca0283a57a29bc48043f18678.tar.gz
* gimple-fold.c (fold_gimple_assign): Fix condition guarding
ipa-devirt path; fix thinko there. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 747c0aa0b35..2e0f2bff438 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -372,11 +372,11 @@ fold_gimple_assign (gimple_stmt_iterator *si)
tree val = OBJ_TYPE_REF_EXPR (rhs);
if (is_gimple_min_invariant (val))
return val;
- else if (flag_devirtualize && virtual_method_call_p (val))
+ else if (flag_devirtualize && virtual_method_call_p (rhs))
{
bool final;
vec <cgraph_node *>targets
- = possible_polymorphic_call_targets (val, stmt, &final);
+ = possible_polymorphic_call_targets (rhs, stmt, &final);
if (final && targets.length () <= 1 && dbg_cnt (devirt))
{
tree fndecl;
@@ -395,7 +395,8 @@ fold_gimple_assign (gimple_stmt_iterator *si)
? targets[0]->name ()
: "__builtin_unreachable");
}
- val = fold_convert (TREE_TYPE (val), fndecl);
+ val = fold_convert (TREE_TYPE (val),
+ build_fold_addr_expr_loc (loc, fndecl));
STRIP_USELESS_TYPE_CONVERSION (val);
return val;
}