diff options
author | Marek Polacek <polacek@redhat.com> | 2015-06-29 14:17:13 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-06-29 14:17:13 +0000 |
commit | f461569a23508a49b913787cc76ab42bc24146f4 (patch) | |
tree | 455965b67ca0c58d772f8ae71e821ca9badb8147 /gcc/fold-const.c | |
parent | fd7b3ef52aa44a4e6de739e63b2c6a34cc6b00bc (diff) | |
download | gcc-f461569a23508a49b913787cc76ab42bc24146f4.zip gcc-f461569a23508a49b913787cc76ab42bc24146f4.tar.gz gcc-f461569a23508a49b913787cc76ab42bc24146f4.tar.bz2 |
fold-const.c (fold_binary_loc): Move X - (X / Y) * Y -> X % Y to ...
* fold-const.c (fold_binary_loc): Move X - (X / Y) * Y -> X % Y to ...
* match.pd: ... pattern here.
Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>
From-SVN: r225120
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 7b9502e..a447452 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10509,19 +10509,6 @@ fold_binary_loc (location_t loc, fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0))); - /* X - (X / Y) * Y is X % Y. */ - if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)) - && TREE_CODE (arg1) == MULT_EXPR - && TREE_CODE (TREE_OPERAND (arg1, 0)) == TRUNC_DIV_EXPR - && operand_equal_p (arg0, - TREE_OPERAND (TREE_OPERAND (arg1, 0), 0), 0) - && operand_equal_p (TREE_OPERAND (TREE_OPERAND (arg1, 0), 1), - TREE_OPERAND (arg1, 1), 0)) - return - fold_convert_loc (loc, type, - fold_build2_loc (loc, TRUNC_MOD_EXPR, TREE_TYPE (arg0), - arg0, TREE_OPERAND (arg1, 1))); - if (! FLOAT_TYPE_P (type)) { /* Fold A - (A & B) into ~B & A. */ |