summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-18 08:51:44 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-18 08:51:44 +0000
commit7bdf94010bb5f6f86d10dc05b54514bde59386de (patch)
tree950dd3c7ece5ab87c11a5deedbb5b484f7e4cf88 /gcc/tree-sra.c
parentd8341d394fc16269d4d3e82755f9c7d156fc1191 (diff)
downloadgcc-7bdf94010bb5f6f86d10dc05b54514bde59386de.tar.gz
PR tree-opt/22103
* tree-sra.c (generate_copy_inout): Handle SSA_NAME complex destinations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 7abdd3de34e..e54598a4b3b 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1526,7 +1526,22 @@ generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr,
struct sra_elt *c;
tree t;
- if (elt->replacement)
+ if (!copy_out && TREE_CODE (expr) == SSA_NAME
+ && TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
+ {
+ tree r, i;
+
+ c = lookup_element (elt, integer_zero_node, NULL, NO_INSERT);
+ r = c->replacement;
+ c = lookup_element (elt, integer_one_node, NULL, NO_INSERT);
+ i = c->replacement;
+
+ t = build (COMPLEX_EXPR, elt->type, r, i);
+ t = build (MODIFY_EXPR, void_type_node, expr, t);
+ SSA_NAME_DEF_STMT (expr) = t;
+ append_to_statement_list (t, list_p);
+ }
+ else if (elt->replacement)
{
if (copy_out)
t = build (MODIFY_EXPR, void_type_node, elt->replacement, expr);