OSDN Git Service

* integrate.h (struct inline_remap): Add local_return_label.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Mar 2001 18:37:25 +0000 (18:37 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Mar 2001 18:37:25 +0000 (18:37 +0000)
        * integrate.c (expand_inline_function): Initialize it and emit
        it after copy_insn_notes.
        (copy_insn_list): Don't store local_return_label here.
        (copy_insn_notes): New function split out from copy_insn_list.

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

gcc/ChangeLog
gcc/integrate.c
gcc/integrate.h

index fadf0f2..cfc0e94 100644 (file)
@@ -1,5 +1,13 @@
 2001-03-17  Richard Henderson  <rth@redhat.com>
 
+       * integrate.h (struct inline_remap): Add local_return_label.
+       * integrate.c (expand_inline_function): Initialize it and emit
+       it after copy_insn_notes.
+       (copy_insn_list): Don't store local_return_label here.
+       (copy_insn_notes): New function split out from copy_insn_list.
+
+2001-03-17  Richard Henderson  <rth@redhat.com>
+
        * dwarf2out.c (lookup_filename): Emit .file if the assembler
        is generating .debug_line.
        (dwarf2out_init): Add main_input_filename to the file table first.
index 8ce8490..f26a446 100644 (file)
@@ -87,6 +87,7 @@ static void mark_stores                 PARAMS ((rtx, rtx, void *));
 static void save_parm_insns            PARAMS ((rtx, rtx));
 static void copy_insn_list              PARAMS ((rtx, struct inline_remap *,
                                                 rtx));
+static void copy_insn_notes            PARAMS ((rtx, struct inline_remap *));
 static int compare_blocks               PARAMS ((const PTR, const PTR));
 static int find_block                   PARAMS ((const PTR, const PTR));
 
@@ -778,6 +779,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
   real_label_map
     = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
   map->label_map = real_label_map;
+  map->local_return_label = NULL_RTX;
 
   inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
   map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
@@ -1142,6 +1144,13 @@ expand_inline_function (fndecl, parms, target, ignore, type,
   /* Now copy the insns one by one.  */
   copy_insn_list (insns, map, static_chain_value);
 
+  /* Now copy the REG_NOTES for those insns.  */
+  copy_insn_notes (insns, map);
+
+  /* If the insn sequence required one, emit the return label.  */
+  if (map->local_return_label)
+    emit_label (map->local_return_label);
+
   /* Restore the stack pointer if we saved it above.  */
   if (inl_f->calls_alloca)
     emit_stack_restore (SAVE_BLOCK, stack_save, NULL_RTX);
@@ -1226,7 +1235,6 @@ copy_insn_list (insns, map, static_chain_value)
   register int i;
   rtx insn;
   rtx temp;
-  rtx local_return_label = NULL_RTX;
 #ifdef HAVE_cc0
   rtx cc0_insn = 0;
 #endif
@@ -1391,9 +1399,9 @@ copy_insn_list (insns, map, static_chain_value)
              || (GET_CODE (PATTERN (insn)) == PARALLEL
                  && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == RETURN))
            {
-             if (local_return_label == 0)
-               local_return_label = gen_label_rtx ();
-             pattern = gen_jump (local_return_label);
+             if (map->local_return_label == 0)
+               map->local_return_label = gen_label_rtx ();
+             pattern = gen_jump (map->local_return_label);
            }
          else
            pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
@@ -1578,10 +1586,19 @@ copy_insn_list (insns, map, static_chain_value)
 
       map->insn_map[INSN_UID (insn)] = copy;
     }
+}
+
+/* Copy the REG_NOTES.  Increment const_age, so that only constants
+   from parameters can be substituted in.  These are the only ones
+   that are valid across the entire function.  */
+
+static void
+copy_insn_notes (insns, map)
+     rtx insns;
+     struct inline_remap *map;
+{
+  rtx insn;
 
-  /* Now copy the REG_NOTES.  Increment const_age, so that only constants
-     from parameters can be substituted in.  These are the only ones that
-     are valid across the entire function.  */
   map->const_age++;
   for (insn = insns; insn; insn = NEXT_INSN (insn))
     if (INSN_P (insn)
@@ -1604,9 +1621,6 @@ copy_insn_list (insns, map, static_chain_value)
              remove_note (map->insn_map[INSN_UID (insn)], note);
          }
       }
-
-  if (local_return_label)
-    emit_label (local_return_label);
 }
 \f
 /* Given a chain of PARM_DECLs, ARGS, copy each decl into a VAR_DECL,
index 51fced4..14606a6 100644 (file)
@@ -93,6 +93,9 @@ struct inline_remap
   /* Likewise, this is the copied constraints vector.  */
   rtvec copy_asm_constraints_vector;
 
+  /* Target of a return insn, if needed and inlining.  */
+  rtx local_return_label;
+
   /* Indications for regs being pointers and their alignment.  */
   unsigned char *regno_pointer_align;
   rtx *x_regno_reg_rtx;