re PR tree-optimization/24888 (duplication of local variables after versioning/inlining)
authorJan Hubicka <jh@suse.cz>
Fri, 4 Aug 2006 17:03:32 +0000 (19:03 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 4 Aug 2006 17:03:32 +0000 (17:03 +0000)
PR tree-optimization/24888
* tree-inline.c (expand_call_inline): Do not re-record variables.
(declare_inline_vars): Add variable to unexpanded_var_list.

From-SVN: r115927

gcc/ChangeLog
gcc/tree-inline.c

index af93012c36eb66cff4f522d1984f4c185d758888..642cde8cdb94e5256ed599743de172121dbdc07c 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-04  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimization/24888
+       * tree-inline.c (expand_call_inline): Do not re-record variables.
+       (declare_inline_vars): Add variable to unexpanded_var_list.
+
 2006-08-04  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
            Roger Sayle  <roger@eyesopen.com>
 
index 92d85a89b2b0c45ed7781d1a4298c25d1f562928..b05bf2665f550888b5e222995a03131c07c50be7 100644 (file)
@@ -2163,8 +2163,6 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
   /* Update callgraph if needed.  */
   cgraph_remove_node (cg_edge->callee);
 
-  /* Declare the 'auto' variables added with this inlined body.  */
-  record_vars (BLOCK_VARS (id->block));
   id->block = NULL_TREE;
   successfully_inlined = TRUE;
 
@@ -2556,7 +2554,13 @@ declare_inline_vars (tree block, tree vars)
 {
   tree t;
   for (t = vars; t; t = TREE_CHAIN (t))
-    DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
+    {
+      DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
+      gcc_assert (!TREE_STATIC (t) && !TREE_ASM_WRITTEN (t));
+      cfun->unexpanded_var_list =
+       tree_cons (NULL_TREE, t,
+                  cfun->unexpanded_var_list);
+    }
 
   if (block)
     BLOCK_VARS (block) = chainon (BLOCK_VARS (block), vars);