diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-13 22:58:13 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-13 22:58:13 +0000 |
commit | 60b9b3ae358572c3b9e10c59ce1beb9566df34d6 (patch) | |
tree | 8ff0bc85b42906f5dd2e481e0620be0c340e16de /gcc/gimple.c | |
parent | 65edca84b3cc8bf79d1bf076047d21270e1cb470 (diff) | |
download | gcc-60b9b3ae358572c3b9e10c59ce1beb9566df34d6.tar.gz |
2009-06-14 Richard Guenther <rguenther@suse.de>
PR middle-end/40389
* gimple.c (walk_stmt_load_store_addr_ops): The LHS of a call
has its address taken if NRV was applied and it is addressable.
* tree-ssa-structalias.c (get_constraint_for_address_of): New
function split out from ...
(get_constraint_for_1): ... here.
(handle_rhs_call): Use it to mark the return slot escaped if
it is addressable and NRV was applied.
* g++.dg/torture/pr40389.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148462 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index d3578da28da..24727bc8873 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3264,6 +3264,11 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR) ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0), data); + if (visit_addr + && gimple_call_return_slot_opt_p (stmt) + && gimple_call_lhs (stmt) != NULL_TREE + && TREE_ADDRESSABLE (gimple_call_lhs (stmt))) + ret |= visit_addr (stmt, gimple_call_lhs (stmt), data); } else if (gimple_code (stmt) == GIMPLE_ASM) { |