diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-15 14:07:06 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-15 14:07:06 +0000 |
commit | cb5c5698f8d0bf49ad2e258f5fde46894495387c (patch) | |
tree | f546521b195da8e2a127d8b63d1d3c1dc7552a6b /gcc/sbitmap.c | |
parent | c0eb8726a93facea1a306b982b1dc7523163d016 (diff) | |
download | gcc-cb5c5698f8d0bf49ad2e258f5fde46894495387c.tar.gz |
2002-07-15 Michael Matz <matz@suse.de>,
Daniel Berlin <dberlin@dberlin.org>,
Denis Chertykov <denisc@overta.ru>
Add a new register allocator.
* ra.c: New file.
* ra.h: New file.
* ra-build.c: New file.
* ra-colorize.c: New file.
* ra-debug.c: New file.
* ra-rewrite.c: New file.
* Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
(ra-rewrite.o): New .o files for libbackend.a.
(GTFILES): Add basic-block.h.
* toplev.c (flag_new_regalloc): New.
(f_options): New option "new-ra".
(rest_of_compilation): Call initialize_uninitialized_subregs()
only for the old allocator. If flag_new_regalloc is set, call
new allocator, instead of local_alloc(), global_alloc() and
friends.
* doc/invoke.texi: Document -fnew-ra.
* basic-block.h (FOR_ALL_BB): New.
* config/rs6000/rs6000.c (print_operand): Write small constants
as @l+80.
* df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg.
(df_reg_table_realloc): Make size at least as large as max_reg_num().
(df_insn_table_realloc): Size argument now is absolute, not relative.
Changed all callers.
* gengtype.c (main): Add the pseudo-type "HARD_REG_SET".
* regclass.c (reg_scan_mark_refs): Ignore NULL rtx's.
2002-06-20 Michael Matz <matz@suse.de>
* df.h (struct ref.id): Make unsigned.
* df.c (df_bb_reg_def_chain_create): Remove unsigned cast.
2002-06-13 Michael Matz <matz@suse.de>
* df.h (DF_REF_MODE_CHANGE): New flag.
* df.c (df_def_record_1, df_uses_record): Set this flag for refs
involving subregs with invalid mode changes, when
CLASS_CANNOT_CHANGE_MODE is defined.
2002-05-07 Michael Matz <matz@suse.de>
* reload1.c (fixup_abnormal_edges): Don't insert on NULL edge.
2002-05-03 Michael Matz <matz@suse.de>
* sbitmap.c (sbitmap_difference): Accept sbitmaps of different size.
Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru>
* regclass.c (regclass): Work with all regs which have sets or
refs.
(reg_scan_mark_refs): Count regs inside (clobber ...).
2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de>
* df.c (df_ref_record): Correctly calculate SUBREGs of hardregs.
(df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only
add new refs.
(df_bb_refs_update): Don't clear insns_modified here, ...
(df_analyse): ... but here.
* sbitmap.c (dump_sbitmap_file): New.
(debug_sbitmap): Use it.
* sbitmap.h (dump_sbitmap_file): Add prototype.
2001-08-07 Daniel Berlin <dan@cgsoftware.com>
* df.c (df_insn_modify): Grow the UID table if necessary, rather
than assume all emits go through df_insns_modify.
2001-07-26 Daniel Berlin <dan@cgsoftware.com>
* regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS,
increase REG_N_REFS (like flow does), so that regclass doesn't
think a reg is useless, and thus, not calculate a class, when it
really should have.
2001-01-28 Daniel Berlin <dberlin@redhat.com>
* sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for
dataflow analysis.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55458 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index e581000e877..170d87df839 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -218,13 +218,26 @@ void sbitmap_difference (dst, a, b) sbitmap dst, a, b; { - unsigned int i, n = dst->size; + unsigned int i, dst_size = dst->size; + unsigned int min_size = dst->size; sbitmap_ptr dstp = dst->elms; sbitmap_ptr ap = a->elms; sbitmap_ptr bp = b->elms; - - for (i = 0; i < n; i++) - *dstp++ = *ap++ & ~*bp++; + + /* A should be at least as large as DEST, to have a defined source. */ + if (a->size < dst_size) + abort (); + /* If minuend is smaller, we simply pretend it to be zero bits, i.e. + only copy the subtrahend into dest. */ + if (b->size < min_size) + min_size = b->size; + for (i = 0; i < min_size; i++) + *dstp++ = *ap++ & (~*bp++); + /* Now fill the rest of dest from A, if B was too short. + This makes sense only when destination and A differ. */ + if (dst != a && i != dst_size) + for (; i < dst_size; i++) + *dstp++ = *ap++; } /* Set DST to be (A and B). @@ -658,27 +671,35 @@ dump_sbitmap (file, bmap) } void -debug_sbitmap (bmap) +dump_sbitmap_file (file, bmap) + FILE *file; sbitmap bmap; { unsigned int i, pos; - fprintf (stderr, "n_bits = %d, set = {", bmap->n_bits); + fprintf (file, "n_bits = %d, set = {", bmap->n_bits); for (pos = 30, i = 0; i < bmap->n_bits; i++) if (TEST_BIT (bmap, i)) { if (pos > 70) { - fprintf (stderr, "\n"); + fprintf (file, "\n "); pos = 0; } - fprintf (stderr, "%d ", i); - pos += 1 + (i >= 10) + (i >= 100); + fprintf (file, "%d ", i); + pos += 2 + (i >= 10) + (i >= 100) + (i >= 1000); } - fprintf (stderr, "}\n"); + fprintf (file, "}\n"); +} + +void +debug_sbitmap (bmap) + sbitmap bmap; +{ + dump_sbitmap_file (stderr, bmap); } void |