aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-10-08 15:33:58 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-10-08 15:33:58 +0000
commit7b19209f2934c0ac28445ff2032747552a390f2f (patch)
treedc4fd0ce62886f374accbfc584455a9e48228637 /gcc/bitmap.c
parent76cee070fd46483d818ffee61b7ec12be062afda (diff)
bitmap.h (bitmap_and_into): Update prototype.
* bitmap.h (bitmap_and_into): Update prototype. * bitmap.c (bitmap_and_into): Return true if the target bitmap changed, false otherwise. * df.h (df_dump_insn_problem_function): New function type. (struct df_problem): Add two functions, to dump just before and just after an insn. (DF_RD_PRUNE_DEAD_DEFS): New changable flag. (df_dump_insn_top, df_dump_insn_bottom): New prototypes. * df-core (df_dump_region): Use dump_bb. (df_dump_bb_problem_data): New function. (df_dump_top, df_dump_bottom): Rewrite using df_dump_bb_problem_data. (df_dump_insn_problem_data): New function. (df_dump_insn_top, df_dump_insn_bottom): New functions. * df-scan.c (problem_SCAN): Add NULL fields for new members. * df-problems.c (df_rd_local_compute): Ignore hard registers if DF_NO_HARD_REGS is in effect. (df_rd_transfer_function): If DF_RD_PRUNE_DEAD_DEFS is in effect, prune reaching defs using the LR problem. (df_rd_start_dump): Fix dumping of DEFs map. (df_rd_dump_defs_set): New function. (df_rd_top_dump, df_rd_bottom_dump): Use it. (problem_RD): Add NULL fields for new members. (problem_LR, problem_LIVE): Likewise. (df_chain_bb_dump): New function. (df_chain_top_dump): Dump only for artificial DEFs and USEs, using df_chain_bb_dump. (df_chain_bottom_dump): Likewise. (df_chain_insn_top_dump, df_chain_insn_bottom_dump): New functions. (problem_CHAIN): Add them as new members. (problem_WORD_LR, problem_NOTE): Add NULL fields for new members. (problem_MD): Likewise. * cfgrtl.c (rtl_dump_bb): Use df_dump_insn_top and df_dump_insn_bottom. (print_rtl_with_bb): Likewise. * dce.c (init_dce): Use DF_RD_PRUNE_DEAD_DEFS. * loop-invariant.c (find_defs): Likewise. * loop-iv.c (iv_analysis_loop_init): Likewise. * ree.c (find_and_remove_re): Likewise. * web.c (web_main): Likewise. From-SVN: r192213
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 63f0e099a05..76f70fcdb84 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -916,17 +916,18 @@ bitmap_and (bitmap dst, const_bitmap a, const_bitmap b)
dst->indx = dst->current->indx;
}
-/* A &= B. */
+/* A &= B. Return true if A changed. */
-void
+bool
bitmap_and_into (bitmap a, const_bitmap b)
{
bitmap_element *a_elt = a->first;
const bitmap_element *b_elt = b->first;
bitmap_element *next;
+ bool changed = false;
if (a == b)
- return;
+ return false;
while (a_elt && b_elt)
{
@@ -935,6 +936,7 @@ bitmap_and_into (bitmap a, const_bitmap b)
next = a_elt->next;
bitmap_element_free (a, a_elt);
a_elt = next;
+ changed = true;
}
else if (b_elt->indx < a_elt->indx)
b_elt = b_elt->next;
@@ -947,7 +949,8 @@ bitmap_and_into (bitmap a, const_bitmap b)
for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix];
-
+ if (a_elt->bits[ix] != r)
+ changed = true;
a_elt->bits[ix] = r;
ior |= r;
}
@@ -958,9 +961,17 @@ bitmap_and_into (bitmap a, const_bitmap b)
b_elt = b_elt->next;
}
}
- bitmap_elt_clear_from (a, a_elt);
+
+ if (a_elt)
+ {
+ changed = true;
+ bitmap_elt_clear_from (a, a_elt);
+ }
+
gcc_checking_assert (!a->current == !a->first
&& (!a->current || a->indx == a->current->indx));
+
+ return changed;
}