From: rguenth Date: Sat, 13 Sep 2008 16:29:22 +0000 (+0000) Subject: 2008-09-13 Richard Guenther X-Git-Tag: upstream/4.9.2~39688 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3f2662fc5ec011321736ee450d95f1909757ecb;p=platform%2Fupstream%2Flinaro-gcc.git 2008-09-13 Richard Guenther PR middle-end/30141 * tree-nested.c (finalize_nesting_tree_1): Generate valid gimple stores for memory rhs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140346 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7375041..3e9707c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-09-13 Richard Guenther + + PR middle-end/30141 + * tree-nested.c (finalize_nesting_tree_1): Generate valid + gimple stores for memory rhs. + 2008-09-13 H.J. Lu PR rtl-optimization/37489 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); + } } }