2002-06-01 Daniel Berlin <dberlin@dberlin.org>
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Jun 2002 21:09:52 +0000 (21:09 +0000)
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Jun 2002 21:09:52 +0000 (21:09 +0000)
* tree-inline.c (expand_call_inline): Make the statement
expression we generate have a COMPOUND_STMT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54153 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-inline.c

index 9758865..e0f3d48 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-01  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree-inline.c (expand_call_inline): Make the statement
+       expression we generate have a COMPOUND_STMT.    
+
 2002-06-01  Roger Sayle  <roger@eyesopen.com>
 
        * gcse.c (cprop_cc0_jump): Function deleted.
@@ -3264,6 +3269,7 @@ config/alpha:
        (CPP_SPEC): Remove ieee defines.
        * freebsd.h, netbsd.h: Remove ieee defines and cpp_cpu.
 
+>>>>>>> 1.14095
 2002-05-14  Richard Henderson  <rth@redhat.com>
 
        * config/i386/i386.c (ix86_save_reg): Make regno unsigned.
index 5fcd892..9485243 100644 (file)
@@ -782,6 +782,7 @@ expand_call_inline (tp, walk_subtrees, data)
   inline_data *id;
   tree t;
   tree expr;
+  tree stmt;
   tree chain;
   tree fn;
   tree scope_stmt;
@@ -873,10 +874,10 @@ expand_call_inline (tp, walk_subtrees, data)
      for the return statements within the function to jump to.  The
      type of the statement expression is the return type of the
      function call.  */
-  expr = build1 (STMT_EXPR, TREE_TYPE (TREE_TYPE (fn)), NULL_TREE);
+  expr = build1 (STMT_EXPR, TREE_TYPE (TREE_TYPE (fn)), make_node (COMPOUND_STMT));
   /* There is no scope associated with the statement-expression.  */
   STMT_EXPR_NO_SCOPE (expr) = 1;
-
+  stmt = STMT_EXPR_STMT (expr);
   /* Local declarations will be replaced by their equivalents in this
      map.  */
   st = id->decl_map;
@@ -891,7 +892,7 @@ expand_call_inline (tp, walk_subtrees, data)
      parameters.  */
   expand_calls_inline (&arg_inits, id);
   /* And add them to the tree.  */
-  STMT_EXPR_STMT (expr) = chainon (STMT_EXPR_STMT (expr), arg_inits);
+  COMPOUND_BODY (stmt) = chainon (COMPOUND_BODY (stmt), arg_inits);
 
   /* Record the function we are about to inline so that we can avoid
      recursing into it.  */
@@ -926,8 +927,8 @@ expand_call_inline (tp, walk_subtrees, data)
   SCOPE_BEGIN_P (scope_stmt) = 1;
   SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
   remap_block (scope_stmt, DECL_ARGUMENTS (fn), id);
-  TREE_CHAIN (scope_stmt) = STMT_EXPR_STMT (expr);
-  STMT_EXPR_STMT (expr) = scope_stmt;
+  TREE_CHAIN (scope_stmt) = COMPOUND_BODY (stmt);
+  COMPOUND_BODY (stmt) = scope_stmt;
 
   /* Tell the debugging backends that this block represents the
      outermost scope of the inlined function.  */
@@ -935,34 +936,34 @@ expand_call_inline (tp, walk_subtrees, data)
     BLOCK_ABSTRACT_ORIGIN (SCOPE_STMT_BLOCK (scope_stmt)) = DECL_ORIGIN (fn);
 
   /* Declare the return variable for the function.  */
-  STMT_EXPR_STMT (expr)
-    = chainon (STMT_EXPR_STMT (expr),
+  COMPOUND_BODY (stmt)
+    = chainon (COMPOUND_BODY (stmt),
               declare_return_variable (id, &use_stmt));
 
   /* After we've initialized the parameters, we insert the body of the
      function itself.  */
-  inlined_body = &STMT_EXPR_STMT (expr);
+  inlined_body = &COMPOUND_BODY (stmt);
   while (*inlined_body)
     inlined_body = &TREE_CHAIN (*inlined_body);
   *inlined_body = copy_body (id);
 
-  /* Close the block for the parameters.  */
-  scope_stmt = build_stmt (SCOPE_STMT, DECL_INITIAL (fn));
-  SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
-  remap_block (scope_stmt, NULL_TREE, id);
-  STMT_EXPR_STMT (expr)
-    = chainon (STMT_EXPR_STMT (expr), scope_stmt);
-
   /* After the body of the function comes the RET_LABEL.  This must come
      before we evaluate the returned value below, because that evalulation
      may cause RTL to be generated.  */
-  STMT_EXPR_STMT (expr)
-    = chainon (STMT_EXPR_STMT (expr),
+  COMPOUND_BODY (stmt)
+    = chainon (COMPOUND_BODY (stmt),
               build_stmt (LABEL_STMT, id->ret_label));
 
   /* Finally, mention the returned value so that the value of the
      statement-expression is the returned value of the function.  */
-  STMT_EXPR_STMT (expr) = chainon (STMT_EXPR_STMT (expr), use_stmt);
+  COMPOUND_BODY (stmt) = chainon (COMPOUND_BODY (stmt), use_stmt);
+  
+  /* Close the block for the parameters.  */
+  scope_stmt = build_stmt (SCOPE_STMT, DECL_INITIAL (fn));
+  SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
+  remap_block (scope_stmt, NULL_TREE, id);
+  COMPOUND_BODY (stmt)
+    = chainon (COMPOUND_BODY (stmt), scope_stmt);
 
   /* Clean up.  */
   splay_tree_delete (id->decl_map);