diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-18 22:42:41 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-18 22:42:41 +0000 |
commit | c3dfa4e8f593c2a1a43178825a1013edbf4f009c (patch) | |
tree | 070f1def188c90a7cf968b88a5a1f1a8d66b386d /gcc/integrate.c | |
parent | 71f6c349ca12779d8734a626ad61de6515cb93a4 (diff) | |
download | gcc-c3dfa4e8f593c2a1a43178825a1013edbf4f009c.tar.gz |
* integrate.c (get_label_from_map): New function.
(expand_inline_function): Use it. Initialize the label_map to
NULL_RTX instead of gen_label_rtx.
(copy_rtx_and_substitute): Use get_label_from_map.
* integrate.h (get_label_from_map): New function.
(set_label_from_map): New macro.
* unroll.c (unroll_loop): Use them.
(copy_loop_body): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17139 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index 70aaf16f2e6..e88f16aa59f 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -77,6 +77,25 @@ static void set_block_abstract_flags PROTO((tree, int)); void set_decl_abstract_flags PROTO((tree, int)); +/* Returns the Ith entry in the label_map contained in MAP. If the + Ith entry has not yet been set, it is assumed to be a fresh label. + Essentially, we use this function to perform a lazy initialization + of label_map, thereby avoiding huge memory explosions when the + label_map gets very large. */ +rtx +get_label_from_map (map, i) + struct inline_remap* map; + int i; +{ + rtx x = map->label_map[i]; + + if (x == NULL_RTX) + x = map->label_map[i] = gen_label_rtx(); + + return x; +} + + /* Zero if the current function (whose FUNCTION_DECL is FNDECL) is safe and reasonable to integrate into other functions. Nonzero means value is a warning message with a single %s @@ -1767,7 +1786,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, /* Make new label equivalences for the labels in the called function. */ for (i = min_labelno; i < max_labelno; i++) - map->label_map[i] = gen_label_rtx (); + map->label_map[i] = NULL_RTX; /* Perform postincrements before actually calling the function. */ emit_queue (); @@ -1966,7 +1985,9 @@ expand_inline_function (fndecl, parms, target, ignore, type, break; case CODE_LABEL: - copy = emit_label (map->label_map[CODE_LABEL_NUMBER (insn)]); + copy = + emit_label (get_label_from_map(map, + CODE_LABEL_NUMBER (insn))); LABEL_NAME (copy) = LABEL_NAME (insn); map->const_age++; break; @@ -1989,7 +2010,8 @@ expand_inline_function (fndecl, parms, target, ignore, type, if (copy && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END)) { - rtx label = map->label_map[NOTE_BLOCK_NUMBER (copy)]; + rtx label = + get_label_from_map (map, NOTE_BLOCK_NUMBER (copy)); /* We have to forward these both to match the new exception region. */ @@ -2404,14 +2426,15 @@ copy_rtx_and_substitute (orig, map) return gen_rtx (code, VOIDmode, copy); case CODE_LABEL: - LABEL_PRESERVE_P (map->label_map[CODE_LABEL_NUMBER (orig)]) + LABEL_PRESERVE_P (get_label_from_map (map, CODE_LABEL_NUMBER (orig))) = LABEL_PRESERVE_P (orig); - return map->label_map[CODE_LABEL_NUMBER (orig)]; + return get_label_from_map (map, CODE_LABEL_NUMBER (orig)); case LABEL_REF: copy = gen_rtx (LABEL_REF, mode, LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0) - : map->label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]); + : get_label_from_map (map, + CODE_LABEL_NUMBER (XEXP (orig, 0)))); LABEL_OUTSIDE_LOOP_P (copy) = LABEL_OUTSIDE_LOOP_P (orig); /* The fact that this label was previously nonlocal does not mean |