summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/dce.c7
-rw-r--r--gcc/tree-dfa.c29
-rw-r--r--gcc/tree-ssa-operands.c10
-rw-r--r--gcc/tree-ssa-structalias.c3
5 files changed, 32 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81d884b242d..b46a7835686 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2009-05-29 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-operands.c (get_expr_operands): Do not handle
+ INDIRECT_REFs in the handled-component case. Remove
+ unused get_ref_base_and_extent case.
+ * tree-dfa.c (get_ref_base_and_extent): Avoid calling
+ tree_low_cst and host_integerp where possible.
+ * tree-ssa-structalias.c (equiv_class_label_eq): Check hash
+ codes for equivalence.
+ * dce.c (find_call_stack_args): Avoid redundant bitmap queries.
+
2009-05-29 David Billinghurst <billingd@gcc.gnu.org>
* config.gcc: Add i386/t-fprules-softfp and soft-fp/t-softfp
diff --git a/gcc/dce.c b/gcc/dce.c
index abdd433cb0e..2d1bd7ada29 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -354,8 +354,8 @@ find_call_stack_args (rtx call_insn, bool do_mark, bool fast,
}
for (byte = off; byte < off + INTVAL (MEM_SIZE (mem)); byte++)
{
- gcc_assert (!bitmap_bit_p (sp_bytes, byte - min_sp_off));
- bitmap_set_bit (sp_bytes, byte - min_sp_off);
+ if (!bitmap_set_bit (sp_bytes, byte - min_sp_off))
+ gcc_unreachable ();
}
}
@@ -442,9 +442,8 @@ find_call_stack_args (rtx call_insn, bool do_mark, bool fast,
{
if (byte < min_sp_off
|| byte >= max_sp_off
- || !bitmap_bit_p (sp_bytes, byte - min_sp_off))
+ || !bitmap_clear_bit (sp_bytes, byte - min_sp_off))
break;
- bitmap_clear_bit (sp_bytes, byte - min_sp_off);
}
if (!deletable_insn_p (insn, fast, NULL))
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index d4a379c333c..4fecd01c423 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -750,7 +750,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
switch (TREE_CODE (exp))
{
case BIT_FIELD_REF:
- bit_offset += tree_low_cst (TREE_OPERAND (exp, 2), 0);
+ bit_offset += TREE_INT_CST_LOW (TREE_OPERAND (exp, 2));
break;
case COMPONENT_REF:
@@ -761,13 +761,14 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == UNION_TYPE)
seen_union = true;
- if (this_offset && TREE_CODE (this_offset) == INTEGER_CST)
+ if (this_offset
+ && TREE_CODE (this_offset) == INTEGER_CST
+ && host_integerp (this_offset, 0))
{
- HOST_WIDE_INT hthis_offset = tree_low_cst (this_offset, 0);
-
+ HOST_WIDE_INT hthis_offset = TREE_INT_CST_LOW (this_offset);
hthis_offset *= BITS_PER_UNIT;
bit_offset += hthis_offset;
- bit_offset += tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
+ bit_offset += TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field));
}
else
{
@@ -787,18 +788,20 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
case ARRAY_RANGE_REF:
{
tree index = TREE_OPERAND (exp, 1);
- tree low_bound = array_ref_low_bound (exp);
- tree unit_size = array_ref_element_size (exp);
+ tree low_bound, unit_size;
/* If the resulting bit-offset is constant, track it. */
- if (host_integerp (index, 0)
- && host_integerp (low_bound, 0)
- && host_integerp (unit_size, 1))
+ if (TREE_CODE (index) == INTEGER_CST
+ && host_integerp (index, 0)
+ && (low_bound = array_ref_low_bound (exp),
+ host_integerp (low_bound, 0))
+ && (unit_size = array_ref_element_size (exp),
+ host_integerp (unit_size, 1)))
{
- HOST_WIDE_INT hindex = tree_low_cst (index, 0);
+ HOST_WIDE_INT hindex = TREE_INT_CST_LOW (index);
- hindex -= tree_low_cst (low_bound, 0);
- hindex *= tree_low_cst (unit_size, 1);
+ hindex -= TREE_INT_CST_LOW (low_bound);
+ hindex *= TREE_INT_CST_LOW (unit_size);
hindex *= BITS_PER_UNIT;
bit_offset += hindex;
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 4a8aee7c20c..0f3c829713e 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -904,19 +904,9 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
case REALPART_EXPR:
case IMAGPART_EXPR:
{
- tree ref;
- HOST_WIDE_INT offset, size, maxsize;
-
if (TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
- ref = get_ref_base_and_extent (expr, &offset, &size, &maxsize);
- if (TREE_CODE (ref) == INDIRECT_REF)
- {
- get_indirect_ref_operands (stmt, ref, flags, false);
- flags |= opf_no_vops;
- }
-
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
if (code == COMPONENT_REF)
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index ea47ec61d36..827a9162234 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1864,7 +1864,8 @@ equiv_class_label_eq (const void *p1, const void *p2)
{
const_equiv_class_label_t const eql1 = (const_equiv_class_label_t) p1;
const_equiv_class_label_t const eql2 = (const_equiv_class_label_t) p2;
- return bitmap_equal_p (eql1->labels, eql2->labels);
+ return (eql1->hashcode == eql2->hashcode
+ && bitmap_equal_p (eql1->labels, eql2->labels));
}
/* Lookup a equivalence class in TABLE by the bitmap of LABELS it