OSDN Git Service

(save_constants_in_decl_trees): New function.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 1996 22:43:08 +0000 (22:43 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 1996 22:43:08 +0000 (22:43 +0000)
(save_for_inline_copying, save_for_inline_nocopy): Call it.

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

gcc/integrate.c

index 01644b5..4ecbfb2 100644 (file)
@@ -67,6 +67,7 @@ static void note_modified_parmregs PROTO((rtx, rtx));
 static rtx copy_for_inline     PROTO((rtx));
 static void integrate_parm_decls PROTO((tree, struct inline_remap *, rtvec));
 static void integrate_decl_tree        PROTO((tree, int, struct inline_remap *));
+static void save_constants_in_decl_trees PROTO ((tree));
 static void subst_constants    PROTO((rtx *, rtx, struct inline_remap *));
 static void restore_constants  PROTO((rtx *));
 static void set_block_origin_self PROTO((tree));
@@ -430,6 +431,10 @@ save_for_inline_copying (fndecl)
              save_constants (&REG_NOTES (insn));
          }
 
+      /* Also scan all decls, and replace any constant pool references with the
+        actual constant.  */
+      save_constants_in_decl_trees (DECL_INITIAL (fndecl));
+
       /* Clear out the constant pool so that we can recreate it with the
         copied constants below.  */
       init_const_rtx_hash_table ();
@@ -790,6 +795,10 @@ save_for_inline_nocopy (fndecl)
        }
     }
 
+  /* Also scan all decls, and replace any constant pool references with the
+     actual constant.  */
+  save_constants_in_decl_trees (DECL_INITIAL (fndecl));
+
   /* We have now allocated all that needs to be allocated permanently
      on the rtx obstack.  Set our high-water mark, so that we
      can free the rest of this when the time comes.  */
@@ -2031,6 +2040,23 @@ integrate_decl_tree (let, level, map)
        }
     }
 }
+
+/* Given a BLOCK node LET, search for all DECL_RTL fields, and pass them
+   through save_constants.  */
+
+static void
+save_constants_in_decl_trees (let)
+     tree let;
+{
+  tree t;
+
+  for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
+    if (DECL_RTL (t) != 0)
+      save_constants (&DECL_RTL (t));
+
+  for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t))
+    save_constants_in_decl_trees (t);
+}
 \f
 /* Create a new copy of an rtx.
    Recursively copies the operands of the rtx,