integrate.h (struct inline_remap): Add local_return_label.

* 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.

From-SVN: r40581
This commit is contained in:
Richard Henderson 2001-03-17 10:37:25 -08:00 committed by Richard Henderson
parent e72dd89c98
commit 464186fb60
3 changed files with 35 additions and 10 deletions

View file

@ -1,3 +1,11 @@
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

View 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);
}
/* Given a chain of PARM_DECLs, ARGS, copy each decl into a VAR_DECL,

View 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;