aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index cfa1dd4..8f9fec5 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1995,6 +1995,15 @@ finalize_nesting_tree_1 (struct nesting_info *root)
root->frame_decl, field, NULL_TREE);
stmt = gimple_build_assign (y, x);
gimple_seq_add_stmt (&stmt_list, stmt);
+ /* If the assignment is from a non-register the stmt is
+ not valid gimple. Make it so by using a temporary instead. */
+ if (!is_gimple_reg (x)
+ && is_gimple_reg_type (TREE_TYPE (x)))
+ {
+ gimple_stmt_iterator gsi = gsi_last (stmt_list);
+ x = init_tmp_var (root, x, &gsi);
+ gimple_assign_set_rhs1 (stmt, x);
+ }
}
}