diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-07 18:39:11 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-07 18:39:11 +0000 |
commit | bb217be2ef235e0d902ff1df0166021a3db9fd14 (patch) | |
tree | 98a65d5d31b70305f89310e6bee59826c2bb6216 /gcc/value-prof.c | |
parent | cee60343a6a96dcd44724027c6d980780b95c5e7 (diff) | |
download | gcc-bb217be2ef235e0d902ff1df0166021a3db9fd14.tar.gz |
PR bootstrap/47187
* value-prof.c (gimple_stringop_fixed_value): Handle
lhs of the call properly.
* gcc.dg/tree-prof/pr47187.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168581 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r-- | gcc/value-prof.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c index 414b94887fe..0a36ed210c8 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1,5 +1,5 @@ /* Transformations based on profile information for values. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -1401,6 +1401,21 @@ gimple_stringop_fixed_value (gimple vcall_stmt, tree icall_size, int prob, e_vj->probability = REG_BR_PROB_BASE; e_vj->count = all - count; + /* Insert PHI node for the call result if necessary. */ + if (gimple_call_lhs (vcall_stmt) + && TREE_CODE (gimple_call_lhs (vcall_stmt)) == SSA_NAME) + { + tree result = gimple_call_lhs (vcall_stmt); + gimple phi = create_phi_node (result, join_bb); + SSA_NAME_DEF_STMT (result) = phi; + gimple_call_set_lhs (vcall_stmt, + make_ssa_name (SSA_NAME_VAR (result), vcall_stmt)); + add_phi_arg (phi, gimple_call_lhs (vcall_stmt), e_vj, UNKNOWN_LOCATION); + gimple_call_set_lhs (icall_stmt, + make_ssa_name (SSA_NAME_VAR (result), icall_stmt)); + add_phi_arg (phi, gimple_call_lhs (icall_stmt), e_ij, UNKNOWN_LOCATION); + } + /* Because these are all string op builtins, they're all nothrow. */ gcc_assert (!stmt_could_throw_p (vcall_stmt)); gcc_assert (!stmt_could_throw_p (icall_stmt)); |