summaryrefslogtreecommitdiff
path: root/gcc/df-core.c
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2006-01-20 01:55:52 +0000
committerKenneth Zadeck <zadeck@gcc.gnu.org>2006-01-20 01:55:52 +0000
commit3b8266e279c432acdc9feca326cf7410ca584f68 (patch)
tree11d804c9083262e47c2e64640c3d442deb7b9dc4 /gcc/df-core.c
parenta6d8ef6c5c0932ddeec7b0f72b1d6f10ebcf02a7 (diff)
downloadgcc-3b8266e279c432acdc9feca326cf7410ca584f68.tar.gz
df-scan.c (df_scan_free_bb_info): Added basic block parameter to be able to clean out basic block when not necessary.
2005-01-19 Kenneth Zadeck <zadeck@naturalbridge.com> * df-scan.c (df_scan_free_bb_info): Added basic block parameter to be able to clean out basic block when not necessary. (df_scan_free): Fixed to properly delete information if df is unused before calling df_finish. (df_scan_alloc, df_rescan_blocks, df_reg_chain_unlink, df_insn_create_insn_record, df_bb_refs_record): Fixed formatting or comment typos. (df_bb_refs_delete): New function. (df_refs_delete): Moved per block code to df_bb_refs_delete. * df-core.c (df_set_blocks): Added code to properly clean out unused blocks if they are not part of the blocks to consider. Added additional null check. (df_compact_blocks): Added basic block parameter to free_bb_fun to be able to clean out basic block when not necessary * df.h (df_free_bb_function): Ditto. (df_bb_refs_delete): New function. * df-problems.c (df_ru_free_bb_info, df_rd_set_bb_info, df_lr_set_bb_info, df_ur_free_bb_info, df_urec_free_bb_info):Added basic block parameter to be able to clean out basic block when not necessary. (df_ru_alloc, df_rd_alloc): Fixed dyslexic overflow test. (df_ru_free, df_rd_free, df_lr_free, df_ur_free, df_urec_free): Fixed to properly delete information if df is unused before calling df_finish. From-SVN: r110009
Diffstat (limited to 'gcc/df-core.c')
-rw-r--r--gcc/df-core.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 59602dea291..87d9324d80f 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -354,7 +354,30 @@ df_set_blocks (struct df *df, bitmap blocks)
{
if (blocks)
{
- if (!df->blocks_to_analyze)
+ if (df->blocks_to_analyze)
+ {
+ int p;
+ bitmap diff = BITMAP_ALLOC (NULL);
+ 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];
+ if (*dflow->problem->free_bb_fun)
+ {
+ bitmap_iterator bi;
+ unsigned int bb_index;
+
+ EXECUTE_IF_SET_IN_BITMAP (diff, 0, bb_index, bi)
+ {
+ basic_block bb = BASIC_BLOCK (bb_index);
+ (*dflow->problem->free_bb_fun) (dflow, bb, diff);
+ }
+ }
+ }
+
+ BITMAP_FREE (diff);
+ }
+ else
df->blocks_to_analyze = BITMAP_ALLOC (NULL);
bitmap_copy (df->blocks_to_analyze, blocks);
}
@@ -781,8 +804,10 @@ df_compact_blocks (struct df *df)
These are from orphaned blocks. */
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
- if (problem_temps[i])
- (*dflow->problem->free_bb_fun) (dflow, problem_temps[i]);
+ basic_block bb = BASIC_BLOCK (i);
+ if (problem_temps[i] && bb)
+ (*dflow->problem->free_bb_fun)
+ (dflow, bb, problem_temps[i]);
}
}
}