/* Extends CST as appropriate for the affine combinations COMB. */
widest_int
-wide_int_ext_for_comb (const widest_int &cst, aff_tree *comb)
+wide_int_ext_for_comb (const widest_int &cst, tree type)
{
- return wi::sext (cst, TYPE_PRECISION (comb->type));
+ return wi::sext (cst, TYPE_PRECISION (type));
}
/* Initializes affine combination COMB so that its value is zero in TYPE. */
aff_combination_const (aff_tree *comb, tree type, const widest_int &cst)
{
aff_combination_zero (comb, type);
- comb->offset = wide_int_ext_for_comb (cst, comb);;
+ comb->offset = wide_int_ext_for_comb (cst, comb->type);;
}
/* Sets COMB to single element ELT. */
{
unsigned i, j;
- widest_int scale = wide_int_ext_for_comb (scale_in, comb);
+ widest_int scale = wide_int_ext_for_comb (scale_in, comb->type);
if (scale == 1)
return;
return;
}
- comb->offset = wide_int_ext_for_comb (scale * comb->offset, comb);
+ comb->offset = wide_int_ext_for_comb (scale * comb->offset, comb->type);
for (i = 0, j = 0; i < comb->n; i++)
{
widest_int new_coef
- = wide_int_ext_for_comb (scale * comb->elts[i].coef, comb);
+ = wide_int_ext_for_comb (scale * comb->elts[i].coef, comb->type);
/* A coefficient may become zero due to overflow. Remove the zero
elements. */
if (new_coef == 0)
unsigned i;
tree type;
- widest_int scale = wide_int_ext_for_comb (scale_in, comb);
+ widest_int scale = wide_int_ext_for_comb (scale_in, comb->type);
if (scale == 0)
return;
if (operand_equal_p (comb->elts[i].val, elt, 0))
{
widest_int new_coef
- = wide_int_ext_for_comb (comb->elts[i].coef + scale, comb);
+ = wide_int_ext_for_comb (comb->elts[i].coef + scale, comb->type);
if (new_coef != 0)
{
comb->elts[i].coef = new_coef;
static void
aff_combination_add_cst (aff_tree *c, const widest_int &cst)
{
- c->offset = wide_int_ext_for_comb (c->offset + cst, c);
+ c->offset = wide_int_ext_for_comb (c->offset + cst, c->type);
}
/* Adds COMB2 to COMB1. */
if (TYPE_PRECISION (type) == TYPE_PRECISION (comb_type))
return;
- comb->offset = wide_int_ext_for_comb (comb->offset, comb);
+ comb->offset = wide_int_ext_for_comb (comb->offset, comb->type);
for (i = j = 0; i < comb->n; i++)
{
if (comb->elts[i].coef == 0)
combination COMB. */
static tree
-add_elt_to_tree (tree expr, tree type, tree elt, const widest_int &scale_in,
- aff_tree *comb ATTRIBUTE_UNUSED)
+add_elt_to_tree (tree expr, tree type, tree elt, const widest_int &scale_in)
{
enum tree_code code;
tree type1 = type;
if (POINTER_TYPE_P (type))
type1 = sizetype;
- widest_int scale = wide_int_ext_for_comb (scale_in, comb);
+ widest_int scale = wide_int_ext_for_comb (scale_in, type);
if (scale == -1
&& POINTER_TYPE_P (TREE_TYPE (elt)))
gcc_assert (comb->n == MAX_AFF_ELTS || comb->rest == NULL_TREE);
for (i = 0; i < comb->n; i++)
- expr = add_elt_to_tree (expr, type, comb->elts[i].val, comb->elts[i].coef,
- comb);
+ expr = add_elt_to_tree (expr, type, comb->elts[i].val, comb->elts[i].coef);
if (comb->rest)
- expr = add_elt_to_tree (expr, type, comb->rest, 1, comb);
+ expr = add_elt_to_tree (expr, type, comb->rest, 1);
/* Ensure that we get x - 1, not x + (-1) or x + 0xff..f if x is
unsigned. */
off = comb->offset;
sgn = 1;
}
- return add_elt_to_tree (expr, type, wide_int_to_tree (type1, off), sgn,
- comb);
+ return add_elt_to_tree (expr, type, wide_int_to_tree (type1, off), sgn);
}
/* Copies the tree elements of COMB to ensure that they are not shared. */