summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-29 14:17:13 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-29 14:17:13 +0000
commitef5e7d0d1d32a846712c42ac60fb9b226f2a3814 (patch)
tree455965b67ca0c58d772f8ae71e821ca9badb8147 /gcc/fold-const.c
parentbd79788195e59b579bfcc495ef042c6d2c65e264 (diff)
downloadgcc-ef5e7d0d1d32a846712c42ac60fb9b226f2a3814.tar.gz
* fold-const.c (fold_binary_loc): Move X - (X / Y) * Y -> X % Y to ...
* match.pd: ... pattern here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225120 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 7b9502e2d38..a447452193d 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. */