aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-07-07 03:00:42 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-07-07 01:00:42 +0000
commit6938f93f2ec91e5c8f68469512593efba643caef (patch)
tree94d7441216e1549f60d0ca9d9c850b862731a503 /gcc/tree-ssa-structalias.c
parent1d8f4f9171a9bf20221425decc286348bb91ab15 (diff)
downloadgcc-6938f93f2ec91e5c8f68469512593efba643caef.zip
gcc-6938f93f2ec91e5c8f68469512593efba643caef.tar.gz
gcc-6938f93f2ec91e5c8f68469512593efba643caef.tar.bz2
re PR middle-end/44813 (ipa-split causes ice in ptr_deref_may_alias_decl_p, at tree-ssa-alias.c:173)
PR middle-end/44813 * tree-ssa-uninit.c (ssa_undefined_value_p): Result decl is defined for functions passed by reference. * tree.c (needs_to_live_in_memory): RESULT_DECL don't need to live in memory when passed by reference. * tree-ssa-ccp.c (get_default_value): Only VAR_DECL is undefined at beggining. * ipa-split.c (split_function): Cleanup way return value is passed; handle SSA DECL_BY_REFERENCE retvals. * tree-ssa.c (verify_def): Verify that RESULT_DECL is read only when DECL_BY_REFERENCE is set. * tree-ssa-structalias.c (get_constraint_for_ssa_var, get_fi_for_callee, find_what_p_points_to): Handle RESULT_DECL. * tree-inline.c (declare_return_variable): Get new entry_block argument; when passing by reference ensure that RESULT_DECL is gimple_val. (remap_gimple_op_r): Remap RESULT_DECL ssa name. (remap_gimple_stmt): Handle SSA DECL_BY_REFERENCE returns. * g++.dg/torture/pr44813.C: New testcase. * g++.dg/torture/pr44826.C: New testcase. From-SVN: r161898
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 5a84b58..48a42bd 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2836,7 +2836,8 @@ get_constraint_for_ssa_var (tree t, VEC(ce_s, heap) **results, bool address_p)
/* For parameters, get at the points-to set for the actual parm
decl. */
if (TREE_CODE (t) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (t))
{
get_constraint_for_ssa_var (SSA_NAME_VAR (t), results, address_p);
@@ -3982,7 +3983,8 @@ get_fi_for_callee (gimple call)
if (TREE_CODE (decl) == SSA_NAME)
{
if (TREE_CODE (decl) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (decl)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (decl)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (decl)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (decl))
decl = SSA_NAME_VAR (decl);
return get_vi_for_tree (decl);
@@ -5751,7 +5753,8 @@ find_what_p_points_to (tree p)
/* For parameters, get at the points-to set for the actual parm
decl. */
if (TREE_CODE (p) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (p)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (p))
lookup_p = SSA_NAME_VAR (p);