Fix invalid gimple made by finalize_nesting_tree_1.
authorBernd Schmidt <bernds@codesourcery.com>
Mon, 25 Aug 2014 16:15:49 +0000 (16:15 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 25 Aug 2014 16:15:49 +0000 (16:15 +0000)
* tree-nested.c (finalize_nesting_tree_1): Initialize temporary earlier
rather than modifying the stmt.

From-SVN: r214434

gcc/ChangeLog
gcc/tree-nested.c

index f22f09ffcba5a2c378e8cf0e9f740ded2392e050..c5ef2816273dc0da87a0b20c494f43b40134eb1c 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-25  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * tree-nested.c (finalize_nesting_tree_1): Initialize temporary earlier
+       rather than modifying the stmt.
+
 2014-08-25  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
        * config/rs6000/rs6000.c (rs6000_return_in_msb): Fix fallout from
index 82cec96038540712ba1f12efdd38ebea378b2764..6ca594d9ffece005ab5b65021d57e322dc55156e 100644 (file)
@@ -2715,10 +2715,6 @@ finalize_nesting_tree_1 (struct nesting_info *root)
          else
            x = p;
 
-         y = build3 (COMPONENT_REF, TREE_TYPE (field),
-                     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)
@@ -2726,8 +2722,12 @@ finalize_nesting_tree_1 (struct nesting_info *root)
            {
              gimple_stmt_iterator gsi = gsi_last (stmt_list);
              x = init_tmp_var (root, x, &gsi);
-             gimple_assign_set_rhs1 (stmt, x);
            }
+
+         y = build3 (COMPONENT_REF, TREE_TYPE (field),
+                     root->frame_decl, field, NULL_TREE);
+         stmt = gimple_build_assign (y, x);
+         gimple_seq_add_stmt (&stmt_list, stmt);
        }
     }