diff options
author | Richard Henderson <rth@cygnus.com> | 1999-09-09 00:07:41 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-09-09 00:07:41 -0700 |
commit | 76095e2f540a989ea6ff09bdce8d16c648ceca50 (patch) | |
tree | a7da2e093783d85c65b07fb9ce3252698327f53b /gcc/combine.c | |
parent | e1b3e07d15a82f07afc3ebd6ecf4ee0334a90d65 (diff) | |
download | gcc-76095e2f540a989ea6ff09bdce8d16c648ceca50.zip gcc-76095e2f540a989ea6ff09bdce8d16c648ceca50.tar.gz gcc-76095e2f540a989ea6ff09bdce8d16c648ceca50.tar.bz2 |
combine.c (SUBST): Break out to a real function do_SUBST.
* combine.c (SUBST): Break out to a real function do_SUBST.
(SUBST_INT): Likewise.
* gcse.c (free_pre_mem): Free `temp_bitmap'.
(pre_insert): Free `inserted'.
* loop.c (basic_induction_var): Always set `location'.
* function.c (expand_function_end): Add initial_trampoline as a root.
* rtl.h (init_varasm_once): Declare.
* toplev.c (compile_file): Call it.
* ggc-simple.c (ggc_mark_string_ptr): New.
(ggc_add_string_root): New.
(ggc_collect): Disable collection avoidance temporarily.
* ggc.h (ggc_add_string_root): Declare.
* except.c (create_rethrow_ref): Use ggc_alloc_string.
* optabs.c (init_libfuncs): Likewise.
* varasm.c (named_section): Use ggc_alloc_string.
(make_function_rtl): Likewise.
(make_decl_rtl): Likewise.
(assemble_static_space): Likewise.
(assemble_trampoline_template): Likewise.
(output_constant_def): Likewise.
(force_const_mem): Likewise.
(mark_const_hash_entry): New.
(mark_pool_sym_hash_table): New.
(mark_varasm_state): Use it.
(init_varasm_once): New.
* expr.h (init_one_libfunc): Declare.
* optabs.c (init_one_libfunc): New.
(init_optabs): Use it.
* config/gofast.h: Likewise.
* config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Likewise.
* config/sparc/sparc.h (INIT_TARGET_OPTABS): Likewise.
From-SVN: r29226
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 109 |
1 files changed, 62 insertions, 47 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 97e1375..b0646c2 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -338,58 +338,13 @@ struct undobuf static struct undobuf undobuf; -/* Substitute NEWVAL, an rtx expression, into INTO, a place in some - insn. The substitution can be undone by undo_all. If INTO is already - set to NEWVAL, do not record this change. Because computing NEWVAL might - also call SUBST, we have to compute it before we put anything into - the undo table. */ - -#define SUBST(INTO, NEWVAL) \ - do { rtx _new = (NEWVAL); \ - struct undo *_buf; \ - \ - if (undobuf.frees) \ - _buf = undobuf.frees, undobuf.frees = _buf->next; \ - else \ - _buf = (struct undo *) xmalloc (sizeof (struct undo)); \ - \ - _buf->is_int = 0; \ - _buf->where.r = &INTO; \ - _buf->old_contents.r = INTO; \ - INTO = _new; \ - if (_buf->old_contents.r == INTO) \ - _buf->next = undobuf.frees, undobuf.frees = _buf; \ - else \ - _buf->next = undobuf.undos, undobuf.undos = _buf; \ - } while (0) - -/* Similar to SUBST, but NEWVAL is an int expression. Note that substitution - for the value of a HOST_WIDE_INT value (including CONST_INT) is - not safe. */ - -#define SUBST_INT(INTO, NEWVAL) \ - do { struct undo *_buf; \ - \ - if (undobuf.frees) \ - _buf = undobuf.frees, undobuf.frees = _buf->next; \ - else \ - _buf = (struct undo *) xmalloc (sizeof (struct undo)); \ - \ - _buf->is_int = 1; \ - _buf->where.i = (int *) &INTO; \ - _buf->old_contents.i = INTO; \ - INTO = NEWVAL; \ - if (_buf->old_contents.i == INTO) \ - _buf->next = undobuf.frees, undobuf.frees = _buf; \ - else \ - _buf->next = undobuf.undos, undobuf.undos = _buf; \ - } while (0) - /* Number of times the pseudo being substituted for was found and replaced. */ static int n_occurrences; +static void do_SUBST PROTO((rtx *, rtx)); +static void do_SUBST_INT PROTO((int *, int)); static void init_reg_last_arrays PROTO((void)); static void setup_incoming_promotions PROTO((void)); static void set_nonzero_bits_and_sign_copies PROTO((rtx, rtx)); @@ -453,6 +408,66 @@ static void distribute_links PROTO((rtx)); static void mark_used_regs_combine PROTO((rtx)); static int insn_cuid PROTO((rtx)); +/* Substitute NEWVAL, an rtx expression, into INTO, a place in some + insn. The substitution can be undone by undo_all. If INTO is already + set to NEWVAL, do not record this change. Because computing NEWVAL might + also call SUBST, we have to compute it before we put anything into + the undo table. */ + +static void +do_SUBST(into, newval) + rtx *into, newval; +{ + struct undo *buf; + rtx oldval = *into; + + if (oldval == newval) + return; + + if (undobuf.frees) + buf = undobuf.frees, undobuf.frees = buf->next; + else + buf = (struct undo *) xmalloc (sizeof (struct undo)); + + buf->is_int = 0; + buf->where.r = into; + buf->old_contents.r = oldval; + *into = newval; + + buf->next = undobuf.undos, undobuf.undos = buf; +} + +#define SUBST(INTO, NEWVAL) do_SUBST(&(INTO), (NEWVAL)) + +/* Similar to SUBST, but NEWVAL is an int expression. Note that substitution + for the value of a HOST_WIDE_INT value (including CONST_INT) is + not safe. */ + +static void +do_SUBST_INT(into, newval) + int *into, newval; +{ + struct undo *buf; + int oldval = *into; + + if (oldval == newval) + return; + + if (undobuf.frees) + buf = undobuf.frees, undobuf.frees = buf->next; + else + buf = (struct undo *) xmalloc (sizeof (struct undo)); + + buf->is_int = 1; + buf->where.i = into; + buf->old_contents.i = oldval; + *into = newval; + + buf->next = undobuf.undos, undobuf.undos = buf; +} + +#define SUBST_INT(INTO, NEWVAL) do_SUBST_INT(&(INTO), (NEWVAL)) + /* Main entry point for combiner. F is the first insn of the function. NREGS is the first unused pseudo-reg number. */ |