summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-29 09:49:42 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-29 09:49:42 +0000
commit2adb88139c8475e21d07dc4e7859d9df85767596 (patch)
tree6c80b189fd0b9250df5581608770c18fb098718b /gcc/tree-dfa.c
parent6471e33bce5eb81ad6c18de6fc8048f16fd77e56 (diff)
downloadgcc-2adb88139c8475e21d07dc4e7859d9df85767596.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147973 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c29
1 files changed, 16 insertions, 13 deletions
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;