summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-29 17:16:06 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-29 17:16:06 +0000
commitedbeda1b4e69d851381d12860a1f8050615604df (patch)
tree3bc43c40a0d8cf38e398f3a4c8c7a948126fb865 /gcc/gimplify.c
parenta66b13e495139f604850a6a6af89c0acefeb4de2 (diff)
downloadgcc-edbeda1b4e69d851381d12860a1f8050615604df.tar.gz
2009-03-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r145230 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@145246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 8ed42636642..842ef378a9d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -107,12 +107,14 @@ static enum gimplify_status gimplify_compound_expr (tree *, gimple_seq *, bool);
/* Mark X addressable. Unlike the langhook we expect X to be in gimple
form and we don't do any syntax checking. */
-static void
+void
mark_addressable (tree x)
{
while (handled_component_p (x))
x = TREE_OPERAND (x, 0);
- if (TREE_CODE (x) != VAR_DECL && TREE_CODE (x) != PARM_DECL)
+ if (TREE_CODE (x) != VAR_DECL
+ && TREE_CODE (x) != PARM_DECL
+ && TREE_CODE (x) != RESULT_DECL)
return ;
TREE_ADDRESSABLE (x) = 1;
}
@@ -3056,9 +3058,11 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
to = TREE_OPERAND (*expr_p, 0);
from = TREE_OPERAND (*expr_p, 1);
+ mark_addressable (from);
from_ptr = build_fold_addr_expr (from);
gimplify_arg (&from_ptr, seq_p, EXPR_LOCATION (*expr_p));
+ mark_addressable (to);
to_ptr = build_fold_addr_expr (to);
gimplify_arg (&to_ptr, seq_p, EXPR_LOCATION (*expr_p));