mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 22:51:29 +08:00
Fix PR46758: Do not use int_cst_value.
2010-12-23 Sebastian Pop <sebastian.pop@amd.com> Richard Guenther <rguenther@suse.de> PR tree-optimization/46758 * graphite-sese-to-poly.c (scan_tree_for_params_right_scev): Use tree_int_to_gmp instead of int_cst_value. (scan_tree_for_params_int): Same. (scan_tree_for_params): Same. (pdr_add_data_dimensions): Use ppl_set_inhomogeneous_tree. * gcc.dg/graphite/run-id-pr46758.c: New. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r168211
This commit is contained in:
parent
01be8516aa
commit
bd29eba228
gcc
@ -1,3 +1,13 @@
|
||||
2010-12-23 Sebastian Pop <sebastian.pop@amd.com>
|
||||
Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/46758
|
||||
* graphite-sese-to-poly.c (scan_tree_for_params_right_scev): Use
|
||||
tree_int_to_gmp instead of int_cst_value.
|
||||
(scan_tree_for_params_int): Same.
|
||||
(scan_tree_for_params): Same.
|
||||
(pdr_add_data_dimensions): Use ppl_set_inhomogeneous_tree.
|
||||
|
||||
2010-12-23 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
PR tree-optimization/47002
|
||||
|
@ -612,7 +612,7 @@ scan_tree_for_params_right_scev (sese s, tree e, int var,
|
||||
gcc_assert (TREE_CODE (e) == INTEGER_CST);
|
||||
|
||||
mpz_init (val);
|
||||
mpz_set_si (val, int_cst_value (e));
|
||||
tree_int_to_gmp (e, val);
|
||||
add_value_to_dim (l, expr, val);
|
||||
mpz_clear (val);
|
||||
}
|
||||
@ -626,16 +626,13 @@ scan_tree_for_params_int (tree cst, ppl_Linear_Expression_t expr, mpz_t k)
|
||||
{
|
||||
mpz_t val;
|
||||
ppl_Coefficient_t coef;
|
||||
int v = int_cst_value (cst);
|
||||
tree type = TREE_TYPE (cst);
|
||||
|
||||
mpz_init (val);
|
||||
mpz_set_si (val, 0);
|
||||
|
||||
/* Necessary to not get "-1 = 2^n - 1". */
|
||||
if (v < 0)
|
||||
mpz_sub_ui (val, val, -v);
|
||||
else
|
||||
mpz_add_ui (val, val, v);
|
||||
mpz_set_double_int (val, double_int_sext (tree_to_double_int (cst),
|
||||
TYPE_PRECISION (type)), false);
|
||||
|
||||
mpz_mul (val, val, k);
|
||||
ppl_new_Coefficient (&coef);
|
||||
@ -713,7 +710,7 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
|
||||
mpz_t val;
|
||||
gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
|
||||
mpz_init (val);
|
||||
mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
|
||||
tree_int_to_gmp (TREE_OPERAND (e, 1), val);
|
||||
mpz_mul (val, val, k);
|
||||
scan_tree_for_params (s, TREE_OPERAND (e, 0), c, val);
|
||||
mpz_clear (val);
|
||||
@ -728,7 +725,7 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
|
||||
mpz_t val;
|
||||
gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
|
||||
mpz_init (val);
|
||||
mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
|
||||
tree_int_to_gmp (TREE_OPERAND (e, 0), val);
|
||||
mpz_mul (val, val, k);
|
||||
scan_tree_for_params (s, TREE_OPERAND (e, 1), c, val);
|
||||
mpz_clear (val);
|
||||
@ -1614,10 +1611,13 @@ pdr_add_data_dimensions (ppl_Polyhedron_t accesses, data_reference_p dr,
|
||||
/* subscript - low >= 0 */
|
||||
if (host_integerp (low, 0))
|
||||
{
|
||||
tree minus_low;
|
||||
|
||||
ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
|
||||
ppl_set_coef (expr, subscript, 1);
|
||||
|
||||
ppl_set_inhomogeneous (expr, -int_cst_value (low));
|
||||
minus_low = fold_build1 (NEGATE_EXPR, TREE_TYPE (low), low);
|
||||
ppl_set_inhomogeneous_tree (expr, minus_low);
|
||||
|
||||
ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
|
||||
ppl_Polyhedron_add_constraint (accesses, cstr);
|
||||
@ -1637,7 +1637,7 @@ pdr_add_data_dimensions (ppl_Polyhedron_t accesses, data_reference_p dr,
|
||||
ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
|
||||
ppl_set_coef (expr, subscript, -1);
|
||||
|
||||
ppl_set_inhomogeneous (expr, int_cst_value (high));
|
||||
ppl_set_inhomogeneous_tree (expr, high);
|
||||
|
||||
ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
|
||||
ppl_Polyhedron_add_constraint (accesses, cstr);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-12-22 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
PR tree-optimization/46758
|
||||
* gcc.dg/graphite/run-id-pr46758.c: New.
|
||||
|
||||
2010-12-23 Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
PR fortran/46978
|
||||
|
18
gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c
Normal file
18
gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c
Normal file
@ -0,0 +1,18 @@
|
||||
int
|
||||
movegt (int y, long long a)
|
||||
{
|
||||
int i;
|
||||
int ret = 0;
|
||||
for (i = 0; i < y; i++)
|
||||
if (a == -1LL << 33)
|
||||
ret = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (movegt (1, -1LL << 33) != -1)
|
||||
__builtin_abort ();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user