summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-address.c
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2014-05-06 16:25:05 +0000
committerMike Stump <mrs@gcc.gnu.org>2014-05-06 16:25:05 +0000
commit807e902eea17f3132488c256c963823976b2348c (patch)
treee5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/tree-ssa-address.c
parent6122336c832dc4dfedc49279549caddce86306ff (diff)
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r--gcc/tree-ssa-address.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 741478c4de2..866afcf0265 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -208,15 +208,15 @@ addr_for_mem_ref (struct mem_address *addr, addr_space_t as,
struct mem_addr_template *templ;
if (addr->step && !integer_onep (addr->step))
- st = immed_double_int_const (tree_to_double_int (addr->step), pointer_mode);
+ st = immed_wide_int_const (addr->step, pointer_mode);
else
st = NULL_RTX;
if (addr->offset && !integer_zerop (addr->offset))
- off = immed_double_int_const
- (tree_to_double_int (addr->offset)
- .sext (TYPE_PRECISION (TREE_TYPE (addr->offset))),
- pointer_mode);
+ {
+ offset_int dc = offset_int::from (addr->offset, SIGNED);
+ off = immed_wide_int_const (dc, pointer_mode);
+ }
else
off = NULL_RTX;
@@ -424,7 +424,7 @@ move_fixed_address_to_symbol (struct mem_address *parts, aff_tree *addr)
for (i = 0; i < addr->n; i++)
{
- if (!addr->elts[i].coef.is_one ())
+ if (addr->elts[i].coef != 1)
continue;
val = addr->elts[i].val;
@@ -452,7 +452,7 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
for (i = 0; i < addr->n; i++)
{
- if (!addr->elts[i].coef.is_one ())
+ if (addr->elts[i].coef != 1)
continue;
val = addr->elts[i].val;
@@ -484,7 +484,7 @@ move_pointer_to_base (struct mem_address *parts, aff_tree *addr)
for (i = 0; i < addr->n; i++)
{
- if (!addr->elts[i].coef.is_one ())
+ if (addr->elts[i].coef != 1)
continue;
val = addr->elts[i].val;
@@ -520,7 +520,7 @@ move_variant_to_index (struct mem_address *parts, aff_tree *addr, tree v)
return;
parts->index = fold_convert (sizetype, val);
- parts->step = double_int_to_tree (sizetype, addr->elts[i].coef);
+ parts->step = wide_int_to_tree (sizetype, addr->elts[i].coef);
aff_combination_remove_elt (addr, i);
}
@@ -563,16 +563,15 @@ most_expensive_mult_to_index (tree type, struct mem_address *parts,
addr_space_t as = TYPE_ADDR_SPACE (type);
enum machine_mode address_mode = targetm.addr_space.address_mode (as);
HOST_WIDE_INT coef;
- double_int best_mult, amult, amult_neg;
unsigned best_mult_cost = 0, acost;
tree mult_elt = NULL_TREE, elt;
unsigned i, j;
enum tree_code op_code;
- best_mult = double_int_zero;
+ offset_int best_mult = 0;
for (i = 0; i < addr->n; i++)
{
- if (!addr->elts[i].coef.fits_shwi ())
+ if (!wi::fits_shwi_p (addr->elts[i].coef))
continue;
coef = addr->elts[i].coef.to_shwi ();
@@ -585,7 +584,7 @@ most_expensive_mult_to_index (tree type, struct mem_address *parts,
if (acost > best_mult_cost)
{
best_mult_cost = acost;
- best_mult = addr->elts[i].coef;
+ best_mult = offset_int::from (addr->elts[i].coef, SIGNED);
}
}
@@ -595,8 +594,8 @@ most_expensive_mult_to_index (tree type, struct mem_address *parts,
/* Collect elements multiplied by best_mult. */
for (i = j = 0; i < addr->n; i++)
{
- amult = addr->elts[i].coef;
- amult_neg = double_int_ext_for_comb (-amult, addr);
+ offset_int amult = offset_int::from (addr->elts[i].coef, SIGNED);
+ offset_int amult_neg = -wi::sext (amult, TYPE_PRECISION (addr->type));
if (amult == best_mult)
op_code = PLUS_EXPR;
@@ -620,7 +619,7 @@ most_expensive_mult_to_index (tree type, struct mem_address *parts,
addr->n = j;
parts->index = mult_elt;
- parts->step = double_int_to_tree (sizetype, best_mult);
+ parts->step = wide_int_to_tree (sizetype, best_mult);
}
/* Splits address ADDR for a memory access of type TYPE into PARTS.
@@ -648,8 +647,8 @@ addr_to_parts (tree type, aff_tree *addr, tree iv_cand,
parts->index = NULL_TREE;
parts->step = NULL_TREE;
- if (!addr->offset.is_zero ())
- parts->offset = double_int_to_tree (sizetype, addr->offset);
+ if (addr->offset != 0)
+ parts->offset = wide_int_to_tree (sizetype, addr->offset);
else
parts->offset = NULL_TREE;
@@ -680,9 +679,9 @@ addr_to_parts (tree type, aff_tree *addr, tree iv_cand,
for (i = 0; i < addr->n; i++)
{
part = fold_convert (sizetype, addr->elts[i].val);
- if (!addr->elts[i].coef.is_one ())
+ if (addr->elts[i].coef != 1)
part = fold_build2 (MULT_EXPR, sizetype, part,
- double_int_to_tree (sizetype, addr->elts[i].coef));
+ wide_int_to_tree (sizetype, addr->elts[i].coef));
add_to_parts (parts, part);
}
if (addr->rest)
@@ -890,8 +889,8 @@ copy_ref_info (tree new_ref, tree old_ref)
&& (TREE_INT_CST_LOW (TMR_STEP (new_ref))
< align)))))
{
- unsigned int inc = (mem_ref_offset (old_ref)
- - mem_ref_offset (new_ref)).low;
+ unsigned int inc = (mem_ref_offset (old_ref).to_short_addr ()
+ - mem_ref_offset (new_ref).to_short_addr ());
adjust_ptr_info_misalignment (new_pi, inc);
}
else