aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2016-11-23 12:47:31 +0000
committerBin Cheng <amker@gcc.gnu.org>2016-11-23 12:47:31 +0000
commite25350118c44492fed4ea9f168d0b8596d3d03fc (patch)
treed12ecd7ecb082a700239231e770351f33b176773 /gcc/fold-const.c
parentb54819879e0518b3f1acc5242f9c1d86dd1b9e3c (diff)
downloadgcc-e25350118c44492fed4ea9f168d0b8596d3d03fc.zip
gcc-e25350118c44492fed4ea9f168d0b8596d3d03fc.tar.gz
gcc-e25350118c44492fed4ea9f168d0b8596d3d03fc.tar.bz2
fold-const.c (fold_cond_expr_with_comparison): Move simplification for A == C1 ? A : C2 to below.
* fold-const.c (fold_cond_expr_with_comparison): Move simplification for A == C1 ? A : C2 to below. * match.pd: Move from above to here: (cond (eq (convert1? x) c1) (convert2? x) c2) -> (cond (eq x c1) c1 c2). From-SVN: r242751
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 cbfbc24..6517188 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5210,19 +5210,6 @@ fold_cond_expr_with_comparison (location_t loc, tree type,
}
}
- /* If this is A == C1 ? A : C2 with C1 and C2 constant integers,
- we simplify it into A == C1 ? C1 : C2. */
-
- if (comp_code == EQ_EXPR
- && INTEGRAL_TYPE_P (type)
- && TREE_CODE (arg01) == INTEGER_CST
- && TREE_CODE (arg1) != INTEGER_CST
- && TREE_CODE (arg2) == INTEGER_CST)
- {
- arg1 = fold_convert_loc (loc, type, arg01);
- return fold_build3_loc (loc, COND_EXPR, type, arg0, arg1, arg2);
- }
-
return NULL_TREE;
}