emit-rtl.c (unshare_all_decls): New function.
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Wed, 24 May 2000 03:11:27 +0000 (03:11 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 24 May 2000 03:11:27 +0000 (03:11 +0000)
* emit-rtl.c (unshare_all_decls): New function.
(unshare_all_rtl): Call it.

From-SVN: r34118

gcc/ChangeLog
gcc/emit-rtl.c

index 85e6e23f264b3afcc32b2bb27917e1fb76ac6f4c..38007d85cc43218d7023d663ee5bf73959e13e19 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-24  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * emit-rtl.c (unshare_all_decls): New function.
+       (unshare_all_rtl): Call it.
+
 2000-05-23  Nick Clifton  <nickc@cygnus.com>
 
        * configure.in: Treat 'strongarm' as if it were 'arm' when
index 2123701a5306ea234abeabf34aa66dde497d054f..86d85342e1c5ccfc6d775b71804a85b0d96b2c90 100644 (file)
@@ -178,6 +178,7 @@ static rtx make_call_insn_raw               PARAMS ((rtx));
 static rtx find_line_note              PARAMS ((rtx));
 static void mark_sequence_stack         PARAMS ((struct sequence_stack *));
 static void unshare_all_rtl_1          PARAMS ((rtx));
+static void unshare_all_decls          PARAMS ((tree));
 static hashval_t const_int_htab_hash    PARAMS ((const void *));
 static int const_int_htab_eq            PARAMS ((const void *,
                                                 const void *));
@@ -1697,6 +1698,9 @@ unshare_all_rtl (fndecl, insn)
   for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
     DECL_RTL (decl) = copy_rtx_if_shared (DECL_RTL (decl));
 
+  /* Make sure that virtual stack slots are not shared.  */
+  unshare_all_decls (DECL_INITIAL (fndecl));
+
   /* Unshare just about everything else.  */
   unshare_all_rtl_1 (insn);
   
@@ -1754,6 +1758,23 @@ unshare_all_rtl_1 (insn)
       }
 }
 
+/* Go through all virtual stack slots of a function and copy any
+   shared structure.  */
+static void
+unshare_all_decls (blk)
+     tree blk;
+{
+  tree t;
+
+  /* Copy shared decls.  */
+  for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
+    DECL_RTL (t)  = copy_rtx_if_shared (DECL_RTL (t));
+
+  /* Now process sub-blocks.  */
+  for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
+    unshare_all_decls (t);
+}
+
 /* Mark ORIG as in use, and return a copy of it if it was already in use.
    Recursively does the same for subexpressions.  */