diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-06 19:29:01 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-06 19:29:01 +0000 |
commit | 4b5a4301e03317c1925f733c0395b03e8f16b03b (patch) | |
tree | 33762169b920df538a949d4040921754532aa165 /gcc | |
parent | a8891ab12879a8d2f8421492c85a1b409144cea4 (diff) | |
download | gcc-4b5a4301e03317c1925f733c0395b03e8f16b03b.tar.gz |
* df-core.c (df_set_blocks): Use bitmap_head instead of bitmap.
(df_compact_blocks): Likewise.
* df.h (struct df): Turn hardware_regs_used,
regular_block_artificial_uses, eh_block_artificial_uses,
insns_to_delete, insns_to_rescan, insns_to_notes_rescan into
bitmap_head.
* df-problems.c (df_lr_local_compute, df_lr_confluence_0,
df_byte_lr_alloc, df_simulate_fixup_sets): Update.
* df-scan.c (df_scan_free_internal, df_scan_alloc, df_scan_start_dump,
df_scan_blocks, df_insn_delete, df_insn_rescan,
df_insn_rescan_debug_internal, df_insn_rescan_all,
df_process_deferred_rescans, df_process_deferred_rescans,
df_notes_rescan, df_get_call_refs, df_get_call_refs,
regs_invalidated_by_call_regset, df_get_call_refs, df_bb_refs_collect,
df_record_entry_block_defs, df_record_exit_block_uses,
df_update_exit_block_uses, df_bb_verify, df_entry_block_bitmap_verify,
df_scan_verify): Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160348 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 8 | ||||
-rw-r--r-- | gcc/dce.c | 4 | ||||
-rw-r--r-- | gcc/df-core.c | 46 | ||||
-rw-r--r-- | gcc/df-problems.c | 20 | ||||
-rw-r--r-- | gcc/df-scan.c | 212 | ||||
-rw-r--r-- | gcc/df.h | 12 |
7 files changed, 181 insertions, 141 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c82ec230275..4403b7245ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2010-05-25 Jan Hubicka <jh@suse.cz> + + * df-core.c (df_set_blocks): Use bitmap_head instead of bitmap. + (df_compact_blocks): Likewise. + * df.h (struct df): Turn hardware_regs_used, + regular_block_artificial_uses, eh_block_artificial_uses, + insns_to_delete, insns_to_rescan, insns_to_notes_rescan into + bitmap_head. + * df-problems.c (df_lr_local_compute, df_lr_confluence_0, + df_byte_lr_alloc, df_simulate_fixup_sets): Update. + * df-scan.c (df_scan_free_internal, df_scan_alloc, df_scan_start_dump, + df_scan_blocks, df_insn_delete, df_insn_rescan, + df_insn_rescan_debug_internal, df_insn_rescan_all, + df_process_deferred_rescans, df_process_deferred_rescans, + df_notes_rescan, df_get_call_refs, df_get_call_refs, + regs_invalidated_by_call_regset, df_get_call_refs, df_bb_refs_collect, + df_record_entry_block_defs, df_record_exit_block_uses, + df_update_exit_block_uses, df_bb_verify, df_entry_block_bitmap_verify, + df_scan_verify): Update. + 2010-05-25 Dodji Seketeli <dodji@redhat.com> PR c++/44188 diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 7139e3a7bce..67e5632e6cb 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2367,7 +2367,13 @@ cleanup_cfg (int mode) break; else if ((mode & CLEANUP_CROSSJUMP) && crossjumps_occured) - run_fast_dce (); + { + /* Fast DCE is expensive, we really want to be sure we don't + re-run it just because crossjumping cascade. */ + while (try_optimize_cfg (mode)) + delete_unreachable_blocks (); + run_fast_dce (); + } } else break; diff --git a/gcc/dce.c b/gcc/dce.c index 7191f90414f..38a5b307e7b 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -960,8 +960,8 @@ fast_dce (bool byte_level) df_simulate_fixup_sets has the disadvantage of calling bb_has_eh_pred once per insn, so we cache the information here. */ - bitmap au = df->regular_block_artificial_uses; - bitmap au_eh = df->eh_block_artificial_uses; + bitmap au = &df->regular_block_artificial_uses; + bitmap au_eh = &df->eh_block_artificial_uses; int i; prescan_insns_for_dce (true); diff --git a/gcc/df-core.c b/gcc/df-core.c index 0930a02ce29..8c4b79bca77 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -504,8 +504,9 @@ df_set_blocks (bitmap blocks) /* This block is called to change the focus from one subset to another. */ int p; - bitmap diff = BITMAP_ALLOC (&df_bitmap_obstack); - bitmap_and_compl (diff, df->blocks_to_analyze, blocks); + bitmap_head diff; + bitmap_initialize (&diff, &df_bitmap_obstack); + bitmap_and_compl (&diff, df->blocks_to_analyze, blocks); for (p = 0; p < df->num_problems_defined; p++) { struct dataflow *dflow = df->problems_in_order[p]; @@ -516,7 +517,7 @@ df_set_blocks (bitmap blocks) bitmap_iterator bi; unsigned int bb_index; - EXECUTE_IF_SET_IN_BITMAP (diff, 0, bb_index, bi) + EXECUTE_IF_SET_IN_BITMAP (&diff, 0, bb_index, bi) { basic_block bb = BASIC_BLOCK (bb_index); if (bb) @@ -532,34 +533,34 @@ df_set_blocks (bitmap blocks) } } - BITMAP_FREE (diff); + bitmap_clear (&diff); } else { /* This block of code is executed to change the focus from the entire function to a subset. */ - bitmap blocks_to_reset = NULL; + bitmap_head blocks_to_reset; + bool initialized = false; int p; for (p = 0; p < df->num_problems_defined; p++) { struct dataflow *dflow = df->problems_in_order[p]; if (dflow->optional_p && dflow->problem->reset_fun) { - if (!blocks_to_reset) + if (!initialized) { basic_block bb; - blocks_to_reset = - BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_initialize (&blocks_to_reset, &df_bitmap_obstack); FOR_ALL_BB(bb) { - bitmap_set_bit (blocks_to_reset, bb->index); + bitmap_set_bit (&blocks_to_reset, bb->index); } } - dflow->problem->reset_fun (blocks_to_reset); + dflow->problem->reset_fun (&blocks_to_reset); } } - if (blocks_to_reset) - BITMAP_FREE (blocks_to_reset); + if (initialized) + bitmap_clear (&blocks_to_reset); df->blocks_to_analyze = BITMAP_ALLOC (&df_bitmap_obstack); } @@ -1401,9 +1402,10 @@ df_compact_blocks (void) basic_block bb; void **problem_temps; int size = last_basic_block * sizeof (void *); - bitmap tmp = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head tmp; problem_temps = XNEWVAR (void *, size); + bitmap_initialize (&tmp, &df_bitmap_obstack); for (p = 0; p < df->num_problems_defined; p++) { struct dataflow *dflow = df->problems_in_order[p]; @@ -1412,17 +1414,17 @@ df_compact_blocks (void) dflow problem. */ if (dflow->out_of_date_transfer_functions) { - bitmap_copy (tmp, dflow->out_of_date_transfer_functions); + bitmap_copy (&tmp, dflow->out_of_date_transfer_functions); bitmap_clear (dflow->out_of_date_transfer_functions); - if (bitmap_bit_p (tmp, ENTRY_BLOCK)) + if (bitmap_bit_p (&tmp, ENTRY_BLOCK)) bitmap_set_bit (dflow->out_of_date_transfer_functions, ENTRY_BLOCK); - if (bitmap_bit_p (tmp, EXIT_BLOCK)) + if (bitmap_bit_p (&tmp, EXIT_BLOCK)) bitmap_set_bit (dflow->out_of_date_transfer_functions, EXIT_BLOCK); i = NUM_FIXED_BLOCKS; FOR_EACH_BB (bb) { - if (bitmap_bit_p (tmp, bb->index)) + if (bitmap_bit_p (&tmp, bb->index)) bitmap_set_bit (dflow->out_of_date_transfer_functions, i); i++; } @@ -1463,22 +1465,22 @@ df_compact_blocks (void) if (df->blocks_to_analyze) { - if (bitmap_bit_p (tmp, ENTRY_BLOCK)) + if (bitmap_bit_p (&tmp, ENTRY_BLOCK)) bitmap_set_bit (df->blocks_to_analyze, ENTRY_BLOCK); - if (bitmap_bit_p (tmp, EXIT_BLOCK)) + if (bitmap_bit_p (&tmp, EXIT_BLOCK)) bitmap_set_bit (df->blocks_to_analyze, EXIT_BLOCK); - bitmap_copy (tmp, df->blocks_to_analyze); + bitmap_copy (&tmp, df->blocks_to_analyze); bitmap_clear (df->blocks_to_analyze); i = NUM_FIXED_BLOCKS; FOR_EACH_BB (bb) { - if (bitmap_bit_p (tmp, bb->index)) + if (bitmap_bit_p (&tmp, bb->index)) bitmap_set_bit (df->blocks_to_analyze, i); i++; } } - BITMAP_FREE (tmp); + bitmap_clear (&tmp); free (problem_temps); diff --git a/gcc/df-problems.c b/gcc/df-problems.c index d4921f50778..2c76d011c23 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -925,10 +925,10 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED) unsigned int bb_index; bitmap_iterator bi; - bitmap_clear (df->hardware_regs_used); + bitmap_clear (&df->hardware_regs_used); /* The all-important stack pointer must always be live. */ - bitmap_set_bit (df->hardware_regs_used, STACK_POINTER_REGNUM); + bitmap_set_bit (&df->hardware_regs_used, STACK_POINTER_REGNUM); /* Before reload, there are a few registers that must be forced live everywhere -- which might not already be the case for @@ -937,20 +937,20 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED) { /* Any reference to any pseudo before reload is a potential reference of the frame pointer. */ - bitmap_set_bit (df->hardware_regs_used, FRAME_POINTER_REGNUM); + bitmap_set_bit (&df->hardware_regs_used, FRAME_POINTER_REGNUM); #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM /* Pseudos with argument area equivalences may require reloading via the argument pointer. */ if (fixed_regs[ARG_POINTER_REGNUM]) - bitmap_set_bit (df->hardware_regs_used, ARG_POINTER_REGNUM); + bitmap_set_bit (&df->hardware_regs_used, ARG_POINTER_REGNUM); #endif /* Any constant, or pseudo with constant equivalences, may require reloading from memory using the pic register. */ if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM && fixed_regs[PIC_OFFSET_TABLE_REGNUM]) - bitmap_set_bit (df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM); + bitmap_set_bit (&df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM); } EXECUTE_IF_SET_IN_BITMAP (df_lr->out_of_date_transfer_functions, 0, bb_index, bi) @@ -995,7 +995,7 @@ df_lr_confluence_0 (basic_block bb) { bitmap op1 = &df_lr_get_bb_info (bb->index)->out; if (bb != EXIT_BLOCK_PTR) - bitmap_copy (op1, df->hardware_regs_used); + bitmap_copy (op1, &df->hardware_regs_used); } @@ -1015,7 +1015,7 @@ df_lr_confluence_n (edge e) else bitmap_ior_into (op1, op2); - bitmap_ior_into (op1, df->hardware_regs_used); + bitmap_ior_into (op1, &df->hardware_regs_used); } @@ -2547,7 +2547,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) } df_byte_lr_expand_bitmap (&problem_data->hardware_regs_used, - df->hardware_regs_used); + &df->hardware_regs_used); df_byte_lr_expand_bitmap (&problem_data->invalidated_by_call, regs_invalidated_by_call_regset); @@ -3979,9 +3979,9 @@ df_simulate_fixup_sets (basic_block bb, bitmap live) /* These regs are considered always live so if they end up dying because of some def, we need to bring the back again. */ if (bb_has_eh_pred (bb)) - bitmap_ior_into (live, df->eh_block_artificial_uses); + bitmap_ior_into (live, &df->eh_block_artificial_uses); else - bitmap_ior_into (live, df->regular_block_artificial_uses); + bitmap_ior_into (live, &df->regular_block_artificial_uses); } diff --git a/gcc/df-scan.c b/gcc/df-scan.c index bf285a19287..8bb2ac06b1b 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -257,14 +257,14 @@ df_scan_free_internal (void) df_scan->block_info = NULL; df_scan->block_info_size = 0; - BITMAP_FREE (df->hardware_regs_used); - BITMAP_FREE (df->regular_block_artificial_uses); - BITMAP_FREE (df->eh_block_artificial_uses); + bitmap_clear (&df->hardware_regs_used); + bitmap_clear (&df->regular_block_artificial_uses); + bitmap_clear (&df->eh_block_artificial_uses); BITMAP_FREE (df->entry_block_defs); BITMAP_FREE (df->exit_block_uses); - BITMAP_FREE (df->insns_to_delete); - BITMAP_FREE (df->insns_to_rescan); - BITMAP_FREE (df->insns_to_notes_rescan); + bitmap_clear (&df->insns_to_delete); + bitmap_clear (&df->insns_to_rescan); + bitmap_clear (&df->insns_to_notes_rescan); free_alloc_pool (df_scan->block_pool); free_alloc_pool (problem_data->ref_base_pool); @@ -392,14 +392,14 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) bb_info->artificial_uses = NULL; } - df->hardware_regs_used = BITMAP_ALLOC (&problem_data->reg_bitmaps); - df->regular_block_artificial_uses = BITMAP_ALLOC (&problem_data->reg_bitmaps); - df->eh_block_artificial_uses = BITMAP_ALLOC (&problem_data->reg_bitmaps); + bitmap_initialize (&df->hardware_regs_used, &problem_data->reg_bitmaps); + bitmap_initialize (&df->regular_block_artificial_uses, &problem_data->reg_bitmaps); + bitmap_initialize (&df->eh_block_artificial_uses, &problem_data->reg_bitmaps); df->entry_block_defs = BITMAP_ALLOC (&problem_data->reg_bitmaps); df->exit_block_uses = BITMAP_ALLOC (&problem_data->reg_bitmaps); - df->insns_to_delete = BITMAP_ALLOC (&problem_data->insn_bitmaps); - df->insns_to_rescan = BITMAP_ALLOC (&problem_data->insn_bitmaps); - df->insns_to_notes_rescan = BITMAP_ALLOC (&problem_data->insn_bitmaps); + bitmap_initialize (&df->insns_to_delete, &problem_data->insn_bitmaps); + bitmap_initialize (&df->insns_to_rescan, &problem_data->insn_bitmaps); + bitmap_initialize (&df->insns_to_notes_rescan, &problem_data->insn_bitmaps); df_scan->optional_p = false; } @@ -437,11 +437,11 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED) fprintf (file, ";; invalidated by call \t"); df_print_regset (file, regs_invalidated_by_call_regset); fprintf (file, ";; hardware regs used \t"); - df_print_regset (file, df->hardware_regs_used); + df_print_regset (file, &df->hardware_regs_used); fprintf (file, ";; regular block artificial uses \t"); - df_print_regset (file, df->regular_block_artificial_uses); + df_print_regset (file, &df->regular_block_artificial_uses); fprintf (file, ";; eh block artificial uses \t"); - df_print_regset (file, df->eh_block_artificial_uses); + df_print_regset (file, &df->eh_block_artificial_uses); fprintf (file, ";; entry block defs \t"); df_print_regset (file, df->entry_block_defs); fprintf (file, ";; exit block uses \t"); @@ -682,11 +682,11 @@ df_scan_blocks (void) df->def_info.ref_order = DF_REF_ORDER_NO_TABLE; df->use_info.ref_order = DF_REF_ORDER_NO_TABLE; - df_get_regular_block_artificial_uses (df->regular_block_artificial_uses); - df_get_eh_block_artificial_uses (df->eh_block_artificial_uses); + df_get_regular_block_artificial_uses (&df->regular_block_artificial_uses); + df_get_eh_block_artificial_uses (&df->eh_block_artificial_uses); - bitmap_ior_into (df->eh_block_artificial_uses, - df->regular_block_artificial_uses); + bitmap_ior_into (&df->eh_block_artificial_uses, + &df->regular_block_artificial_uses); /* ENTRY and EXIT blocks have special defs/uses. */ df_get_entry_block_def_set (df->entry_block_defs); @@ -1140,9 +1140,9 @@ df_insn_delete (basic_block bb, unsigned int uid) { if (insn_info) { - bitmap_clear_bit (df->insns_to_rescan, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); - bitmap_set_bit (df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_rescan, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); + bitmap_set_bit (&df->insns_to_delete, uid); } if (dump_file) fprintf (dump_file, "deferring deletion of insn with uid = %d.\n", uid); @@ -1152,9 +1152,9 @@ df_insn_delete (basic_block bb, unsigned int uid) if (dump_file) fprintf (dump_file, "deleting insn with uid = %d.\n", uid); - bitmap_clear_bit (df->insns_to_delete, uid); - bitmap_clear_bit (df->insns_to_rescan, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); + bitmap_clear_bit (&df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_rescan, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); if (insn_info) { struct df_scan_problem_data *problem_data @@ -1257,9 +1257,9 @@ df_insn_rescan (rtx insn) if (dump_file) fprintf (dump_file, "deferring rescan insn with uid = %d.\n", uid); - bitmap_clear_bit (df->insns_to_delete, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); - bitmap_set_bit (df->insns_to_rescan, INSN_UID (insn)); + bitmap_clear_bit (&df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); + bitmap_set_bit (&df->insns_to_rescan, INSN_UID (insn)); return false; } @@ -1268,9 +1268,9 @@ df_insn_rescan (rtx insn) collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32); collection_rec.mw_vec = VEC_alloc (df_mw_hardreg_ptr, stack, 32); - bitmap_clear_bit (df->insns_to_delete, uid); - bitmap_clear_bit (df->insns_to_rescan, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); + bitmap_clear_bit (&df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_rescan, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); if (insn_info) { int luid; @@ -1337,9 +1337,9 @@ df_insn_rescan_debug_internal (rtx insn) if (dump_file) fprintf (dump_file, "deleting debug_insn with uid = %d.\n", uid); - bitmap_clear_bit (df->insns_to_delete, uid); - bitmap_clear_bit (df->insns_to_rescan, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); + bitmap_clear_bit (&df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_rescan, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); if (!insn_info->defs) return false; @@ -1384,7 +1384,9 @@ df_insn_rescan_all (void) basic_block bb; bitmap_iterator bi; unsigned int uid; - bitmap tmp = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head tmp; + + bitmap_initialize (&tmp, &df_bitmap_obstack); if (df->changeable_flags & DF_NO_INSN_RESCAN) { @@ -1398,18 +1400,18 @@ df_insn_rescan_all (void) defer_insn_rescan = true; } - bitmap_copy (tmp, df->insns_to_delete); - EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi) + bitmap_copy (&tmp, &df->insns_to_delete); + EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) { struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); if (insn_info) df_insn_delete (NULL, uid); } - BITMAP_FREE (tmp); - bitmap_clear (df->insns_to_delete); - bitmap_clear (df->insns_to_rescan); - bitmap_clear (df->insns_to_notes_rescan); + bitmap_clear (&tmp); + bitmap_clear (&df->insns_to_delete); + bitmap_clear (&df->insns_to_rescan); + bitmap_clear (&df->insns_to_notes_rescan); FOR_EACH_BB (bb) { @@ -1436,7 +1438,9 @@ df_process_deferred_rescans (void) bool defer_insn_rescan = false; bitmap_iterator bi; unsigned int uid; - bitmap tmp = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head tmp; + + bitmap_initialize (&tmp, &df_bitmap_obstack); if (df->changeable_flags & DF_NO_INSN_RESCAN) { @@ -1453,24 +1457,24 @@ df_process_deferred_rescans (void) if (dump_file) fprintf (dump_file, "starting the processing of deferred insns\n"); - bitmap_copy (tmp, df->insns_to_delete); - EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi) + bitmap_copy (&tmp, &df->insns_to_delete); + EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) { struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); if (insn_info) df_insn_delete (NULL, uid); } - bitmap_copy (tmp, df->insns_to_rescan); - EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi) + bitmap_copy (&tmp, &df->insns_to_rescan); + EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) { struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); if (insn_info) df_insn_rescan (insn_info->insn); } - bitmap_copy (tmp, df->insns_to_notes_rescan); - EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi) + bitmap_copy (&tmp, &df->insns_to_notes_rescan); + EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) { struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); if (insn_info) @@ -1480,10 +1484,10 @@ df_process_deferred_rescans (void) if (dump_file) fprintf (dump_file, "ending the processing of deferred insns\n"); - BITMAP_FREE (tmp); - bitmap_clear (df->insns_to_delete); - bitmap_clear (df->insns_to_rescan); - bitmap_clear (df->insns_to_notes_rescan); + bitmap_clear (&tmp); + bitmap_clear (&df->insns_to_delete); + bitmap_clear (&df->insns_to_rescan); + bitmap_clear (&df->insns_to_notes_rescan); if (no_insn_rescan) df_set_flags (DF_NO_INSN_RESCAN); @@ -2194,16 +2198,16 @@ df_notes_rescan (rtx insn) insn_info->mw_hardregs = df_null_mw_rec; } - bitmap_clear_bit (df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_delete, uid); /* If the insn is set to be rescanned, it does not need to also be notes rescanned. */ - if (!bitmap_bit_p (df->insns_to_rescan, uid)) - bitmap_set_bit (df->insns_to_notes_rescan, INSN_UID (insn)); + if (!bitmap_bit_p (&df->insns_to_rescan, uid)) + bitmap_set_bit (&df->insns_to_notes_rescan, INSN_UID (insn)); return; } - bitmap_clear_bit (df->insns_to_delete, uid); - bitmap_clear_bit (df->insns_to_notes_rescan, uid); + bitmap_clear_bit (&df->insns_to_delete, uid); + bitmap_clear_bit (&df->insns_to_notes_rescan, uid); if (insn_info) { @@ -3452,13 +3456,15 @@ df_get_call_refs (struct df_collection_rec * collection_rec, bool is_sibling_call; unsigned int i; df_ref def; - bitmap defs_generated = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head defs_generated; + + bitmap_initialize (&defs_generated, &df_bitmap_obstack); /* Do not generate clobbers for registers that are the result of the call. This causes ordering problems in the chain building code depending on which def is seen first. */ for (i = 0; VEC_iterate (df_ref, collection_rec->def_vec, i, def); ++i) - bitmap_set_bit (defs_generated, DF_REF_REGNO (def)); + bitmap_set_bit (&defs_generated, DF_REF_REGNO (def)); /* Record the registers used to pass arguments, and explicitly noted as clobbered. */ @@ -3474,7 +3480,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec, if (REG_P (XEXP (XEXP (note, 0), 0))) { unsigned int regno = REGNO (XEXP (XEXP (note, 0), 0)); - if (!bitmap_bit_p (defs_generated, regno)) + if (!bitmap_bit_p (&defs_generated, regno)) df_defs_record (collection_rec, XEXP (note, 0), bb, insn_info, flags); } @@ -3508,7 +3514,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec, EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi) { if (!global_regs[ui] - && (!bitmap_bit_p (defs_generated, ui)) + && (!bitmap_bit_p (&defs_generated, ui)) && (!is_sibling_call || !bitmap_bit_p (df->exit_block_uses, ui) || refers_to_regno_p (ui, ui+1, @@ -3519,7 +3525,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec, -1, -1, VOIDmode); } - BITMAP_FREE (defs_generated); + bitmap_clear (&defs_generated); return; } @@ -3670,8 +3676,8 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb) bitmap_iterator bi; unsigned int regno; bitmap au = bb_has_eh_pred (bb) - ? df->eh_block_artificial_uses - : df->regular_block_artificial_uses; + ? &df->eh_block_artificial_uses + : &df->regular_block_artificial_uses; EXECUTE_IF_SET_IN_BITMAP (au, 0, regno, bi) { @@ -3993,13 +3999,14 @@ df_record_entry_block_defs (bitmap entry_block_defs) void df_update_entry_block_defs (void) { - bitmap refs = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head refs; bool changed = false; - df_get_entry_block_def_set (refs); + bitmap_initialize (&refs, &df_bitmap_obstack); + df_get_entry_block_def_set (&refs); if (df->entry_block_defs) { - if (!bitmap_equal_p (df->entry_block_defs, refs)) + if (!bitmap_equal_p (df->entry_block_defs, &refs)) { struct df_scan_bb_info *bb_info = df_scan_get_bb_info (ENTRY_BLOCK); df_ref_chain_delete_du_chain (bb_info->artificial_defs); @@ -4012,17 +4019,18 @@ df_update_entry_block_defs (void) { struct df_scan_problem_data *problem_data = (struct df_scan_problem_data *) df_scan->problem_data; + gcc_unreachable (); df->entry_block_defs = BITMAP_ALLOC (&problem_data->reg_bitmaps); changed = true; } if (changed) { - df_record_entry_block_defs (refs); - bitmap_copy (df->entry_block_defs, refs); + df_record_entry_block_defs (&refs); + bitmap_copy (df->entry_block_defs, &refs); df_set_bb_dirty (BASIC_BLOCK (ENTRY_BLOCK)); } - BITMAP_FREE (refs); + bitmap_clear (&refs); } @@ -4165,13 +4173,14 @@ df_record_exit_block_uses (bitmap exit_block_uses) void df_update_exit_block_uses (void) { - bitmap refs = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head refs; bool changed = false; - df_get_exit_block_use_set (refs); + bitmap_initialize (&refs, &df_bitmap_obstack); + df_get_exit_block_use_set (&refs); if (df->exit_block_uses) { - if (!bitmap_equal_p (df->exit_block_uses, refs)) + if (!bitmap_equal_p (df->exit_block_uses, &refs)) { struct df_scan_bb_info *bb_info = df_scan_get_bb_info (EXIT_BLOCK); df_ref_chain_delete_du_chain (bb_info->artificial_uses); @@ -4184,17 +4193,18 @@ df_update_exit_block_uses (void) { struct df_scan_problem_data *problem_data = (struct df_scan_problem_data *) df_scan->problem_data; + gcc_unreachable (); df->exit_block_uses = BITMAP_ALLOC (&problem_data->reg_bitmaps); changed = true; } if (changed) { - df_record_exit_block_uses (refs); - bitmap_copy (df->exit_block_uses, refs); + df_record_exit_block_uses (&refs); + bitmap_copy (df->exit_block_uses,& refs); df_set_bb_dirty (BASIC_BLOCK (EXIT_BLOCK)); } - BITMAP_FREE (refs); + bitmap_clear (&refs); } static bool initialized = false; @@ -4550,24 +4560,25 @@ df_bb_verify (basic_block bb) static bool df_entry_block_bitmap_verify (bool abort_if_fail) { - bitmap entry_block_defs = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head entry_block_defs; bool is_eq; - df_get_entry_block_def_set (entry_block_defs); + bitmap_initialize (&entry_block_defs, &df_bitmap_obstack); + df_get_entry_block_def_set (&entry_block_defs); - is_eq = bitmap_equal_p (entry_block_defs, df->entry_block_defs); + is_eq = bitmap_equal_p (&entry_block_defs, df->entry_block_defs); if (!is_eq && abort_if_fail) { print_current_pass (stderr); fprintf (stderr, "entry_block_defs = "); - df_print_regset (stderr, entry_block_defs); + df_print_regset (stderr, &entry_block_defs); fprintf (stderr, "df->entry_block_defs = "); df_print_regset (stderr, df->entry_block_defs); gcc_assert (0); } - BITMAP_FREE (entry_block_defs); + bitmap_clear (&entry_block_defs); return is_eq; } @@ -4579,24 +4590,25 @@ df_entry_block_bitmap_verify (bool abort_if_fail) static bool df_exit_block_bitmap_verify (bool abort_if_fail) { - bitmap exit_block_uses = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head exit_block_uses; bool is_eq; - df_get_exit_block_use_set (exit_block_uses); + bitmap_initialize (&exit_block_uses, &df_bitmap_obstack); + df_get_exit_block_use_set (&exit_block_uses); - is_eq = bitmap_equal_p (exit_block_uses, df->exit_block_uses); + is_eq = bitmap_equal_p (&exit_block_uses, df->exit_block_uses); if (!is_eq && abort_if_fail) { print_current_pass (stderr); fprintf (stderr, "exit_block_uses = "); - df_print_regset (stderr, exit_block_uses); + df_print_regset (stderr, &exit_block_uses); fprintf (stderr, "df->exit_block_uses = "); df_print_regset (stderr, df->exit_block_uses); gcc_assert (0); } - BITMAP_FREE (exit_block_uses); + bitmap_clear (&exit_block_uses); return is_eq; } @@ -4610,8 +4622,8 @@ df_scan_verify (void) { unsigned int i; basic_block bb; - bitmap regular_block_artificial_uses; - bitmap eh_block_artificial_uses; + bitmap_head regular_block_artificial_uses; + bitmap_head eh_block_artificial_uses; if (!df) return; @@ -4632,23 +4644,23 @@ df_scan_verify (void) /* (2) There are various bitmaps whose value may change over the course of the compilation. This step recomputes them to make sure that they have not slipped out of date. */ - regular_block_artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack); - eh_block_artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_initialize (®ular_block_artificial_uses, &df_bitmap_obstack); + bitmap_initialize (&eh_block_artificial_uses, &df_bitmap_obstack); - df_get_regular_block_artificial_uses (regular_block_artificial_uses); - df_get_eh_block_artificial_uses (eh_block_artificial_uses); + df_get_regular_block_artificial_uses (®ular_block_artificial_uses); + df_get_eh_block_artificial_uses (&eh_block_artificial_uses); - bitmap_ior_into (eh_block_artificial_uses, - regular_block_artificial_uses); + bitmap_ior_into (&eh_block_artificial_uses, + ®ular_block_artificial_uses); /* Check artificial_uses bitmaps didn't change. */ - gcc_assert (bitmap_equal_p (regular_block_artificial_uses, - df->regular_block_artificial_uses)); - gcc_assert (bitmap_equal_p (eh_block_artificial_uses, - df->eh_block_artificial_uses)); + gcc_assert (bitmap_equal_p (®ular_block_artificial_uses, + &df->regular_block_artificial_uses)); + gcc_assert (bitmap_equal_p (&eh_block_artificial_uses, + &df->eh_block_artificial_uses)); - BITMAP_FREE (regular_block_artificial_uses); - BITMAP_FREE (eh_block_artificial_uses); + bitmap_clear (®ular_block_artificial_uses); + bitmap_clear (&eh_block_artificial_uses); /* Verify entry block and exit block. These only verify the bitmaps, the refs are verified in df_bb_verify. */ @@ -564,22 +564,22 @@ struct df int num_problems_defined; - bitmap hardware_regs_used; /* The set of hardware registers used. */ + bitmap_head hardware_regs_used; /* The set of hardware registers used. */ /* The set of hard regs that are in the artificial uses at the end of a regular basic block. */ - bitmap regular_block_artificial_uses; + bitmap_head regular_block_artificial_uses; /* The set of hard regs that are in the artificial uses at the end of a basic block that has an EH pred. */ - bitmap eh_block_artificial_uses; + bitmap_head eh_block_artificial_uses; /* The set of hardware registers live on entry to the function. */ bitmap entry_block_defs; bitmap exit_block_uses; /* The set of hardware registers used in exit block. */ /* Insns to delete, rescan or reprocess the notes at next df_rescan_all or df_process_deferred_rescans. */ - bitmap insns_to_delete; - bitmap insns_to_rescan; - bitmap insns_to_notes_rescan; + bitmap_head insns_to_delete; + bitmap_head insns_to_rescan; + bitmap_head insns_to_notes_rescan; int *postorder; /* The current set of basic blocks in reverse postorder. */ int *postorder_inverted; /* The current set of basic blocks |