summaryrefslogtreecommitdiff
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-17 18:37:25 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-17 18:37:25 +0000
commit503bda681ce04d0d6aca16e4bd9888aff5694b89 (patch)
treedaf230a555971819896de93fc75fed34b21916d3 /gcc/integrate.c
parent1ef8ccaef9df38ff424791af75741fc1bef2eac0 (diff)
downloadgcc-503bda681ce04d0d6aca16e4bd9888aff5694b89.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40581 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r--gcc/integrate.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 8ce84909653..f26a4461312 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -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,