tree-inline.c (expand_call_inline): Fix path dealing with making lhs of call statemen...
authorJan Hubicka <hubicka@ucw.cz>
Wed, 4 May 2016 16:42:12 +0000 (18:42 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 4 May 2016 16:42:12 +0000 (16:42 +0000)
* tree-inline.c (expand_call_inline): Fix path dealing with
making lhs of call statement undefined.

From-SVN: r235889

gcc/ChangeLog
gcc/tree-inline.c

index d3d54ec82a538e24678e9ba355a2e455352b551c..92da7b52538710b3fbe6d125779c38d5dac5f93d 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-04  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-inline.c (expand_call_inline): Fix path dealing with
+       making lhs of call statement undefined.
+
 2016-05-04  Jan Hubicka  <hubicka@ucw.cz>
 
        * cgraph.c (cgraph_node::call_for_symbol_thunks_and_aliases):
index 19f202e53714f6a023a448161c5424f36de71cb3..da233b29c4f49b9714826d0afb9ac0c90b0d4dbd 100644 (file)
@@ -4708,7 +4708,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
        {
          tree name = gimple_call_lhs (stmt);
          tree var = SSA_NAME_VAR (name);
-         tree def = ssa_default_def (cfun, var);
+         tree def = var ? ssa_default_def (cfun, var) : NULL;
 
          if (def)
            {
@@ -4719,6 +4719,11 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
            }
          else
            {
+             if (!var)
+               {
+                 tree var = create_tmp_reg_fn (cfun, TREE_TYPE (name), NULL);
+                 SET_SSA_NAME_VAR_OR_IDENTIFIER (name, var);
+               }
              /* Otherwise make this variable undefined.  */
              gsi_remove (&stmt_gsi, true);
              set_ssa_default_def (cfun, var, name);