diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-01-28 05:04:48 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-01-28 05:04:48 +0000 |
commit | b73a6056563470e5b99e79a0dc769c351e906e6e (patch) | |
tree | d5119687bedfd7a7f56d6218696508ae430f8416 /gcc/tree.c | |
parent | 74890d7bbdacf14edfcd1e50bac0e5053a2bdf53 (diff) | |
download | gcc-b73a6056563470e5b99e79a0dc769c351e906e6e.zip gcc-b73a6056563470e5b99e79a0dc769c351e906e6e.tar.gz gcc-b73a6056563470e5b99e79a0dc769c351e906e6e.tar.bz2 |
tree.c (tree_fold_gcd): Delete.
* tree.c (tree_fold_gcd): Delete.
* tree.h (tree_fold_gcd): Remove prototype.
* tree-data-ref.c (tree_fold_divides_p): Don't use tree_fold_gcd to
test whether one constant integer is a multiple of another. Instead
call int_const_binop with TRUNC_MOD_EXPR and test for a zero result.
* fold-const.c (multiple_of_p): We've determined both TOP and
BOTTOM are integer constants so we can call int_const_binop directly
instead of the more generic const_binop.
From-SVN: r121253
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 38 |
1 files changed, 0 insertions, 38 deletions
@@ -7465,44 +7465,6 @@ int_cst_value (tree x) return val; } -/* Returns the greatest common divisor of A and B, which must be - INTEGER_CSTs. */ - -tree -tree_fold_gcd (tree a, tree b) -{ - tree a_mod_b; - tree type = TREE_TYPE (a); - - gcc_assert (TREE_CODE (a) == INTEGER_CST); - gcc_assert (TREE_CODE (b) == INTEGER_CST); - - if (integer_zerop (a)) - return b; - - if (integer_zerop (b)) - return a; - - if (tree_int_cst_sgn (a) == -1) - a = fold_build2 (MULT_EXPR, type, a, - build_int_cst (type, -1)); - - if (tree_int_cst_sgn (b) == -1) - b = fold_build2 (MULT_EXPR, type, b, - build_int_cst (type, -1)); - - while (1) - { - a_mod_b = fold_build2 (FLOOR_MOD_EXPR, type, a, b); - - if (!TREE_INT_CST_LOW (a_mod_b) - && !TREE_INT_CST_HIGH (a_mod_b)) - return b; - - a = b; - b = a_mod_b; - } -} /* Returns unsigned variant of TYPE. */ |