aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-11-13 08:53:23 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-11-13 08:53:23 +0000
commit96994de0451510e3c9904668e79b554bd9163e89 (patch)
tree21bf9c86267ebd593557ecab873e1b2f984da374 /gcc/fold-const.c
parent83633539b751a8ef90378ccd26b73df03c3fe40f (diff)
downloadgcc-96994de0451510e3c9904668e79b554bd9163e89.zip
gcc-96994de0451510e3c9904668e79b554bd9163e89.tar.gz
gcc-96994de0451510e3c9904668e79b554bd9163e89.tar.bz2
match.pd: Implement conditional expression patterns.
2014-11-13 Richard Biener <rguenther@suse.de> * match.pd: Implement conditional expression patterns. * tree-ssa-forwprop.c (forward_propagate_into_cond): Remove them here. (combine_cond_exprs): Remove. (pass_forwprop::execute): Do not call combine_cond_exprs. * fold-const.c (fold_ternary_loc): Remove patterns here. (pedantic_omit_one_operand_loc): Remove. From-SVN: r217465
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4321b1e..2f32d3c 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -121,7 +121,6 @@ static enum tree_code compcode_to_comparison (enum comparison_code);
static int operand_equal_for_comparison_p (tree, tree, tree);
static int twoval_comparison_p (tree, tree *, tree *, int *);
static tree eval_subst (location_t, tree, tree, tree, tree, tree);
-static tree pedantic_omit_one_operand_loc (location_t, tree, tree, tree);
static tree distribute_bit_expr (location_t, enum tree_code, tree, tree, tree);
static tree make_bit_field_ref (location_t, tree, tree,
HOST_WIDE_INT, HOST_WIDE_INT, int);
@@ -3074,27 +3073,6 @@ omit_one_operand_loc (location_t loc, tree type, tree result, tree omitted)
return non_lvalue_loc (loc, t);
}
-/* Similar, but call pedantic_non_lvalue instead of non_lvalue. */
-
-static tree
-pedantic_omit_one_operand_loc (location_t loc, tree type, tree result,
- tree omitted)
-{
- tree t = fold_convert_loc (loc, type, result);
-
- /* If the resulting operand is an empty statement, just return the omitted
- statement casted to void. */
- if (IS_EMPTY_STMT (t) && TREE_SIDE_EFFECTS (omitted))
- return build1_loc (loc, NOP_EXPR, void_type_node,
- fold_ignored_result (omitted));
-
- if (TREE_SIDE_EFFECTS (omitted))
- return build2_loc (loc, COMPOUND_EXPR, type,
- fold_ignored_result (omitted), t);
-
- return pedantic_non_lvalue_loc (loc, t);
-}
-
/* Return a tree for the case when the result of an expression is RESULT
converted to TYPE and OMITTED1 and OMITTED2 were previously operands
of the expression but are now not needed.
@@ -13553,11 +13531,6 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
}
else if (TREE_CODE (arg0) == VECTOR_CST)
{
- if (integer_all_onesp (arg0))
- return pedantic_omit_one_operand_loc (loc, type, arg1, arg2);
- if (integer_zerop (arg0))
- return pedantic_omit_one_operand_loc (loc, type, arg2, arg1);
-
if ((TREE_CODE (arg1) == VECTOR_CST
|| TREE_CODE (arg1) == CONSTRUCTOR)
&& (TREE_CODE (arg2) == VECTOR_CST
@@ -13582,9 +13555,6 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
}
}
- if (operand_equal_p (arg1, op2, 0))
- return pedantic_omit_one_operand_loc (loc, type, arg1, arg0);
-
/* If we have A op B ? A : C, we may be able to convert this to a
simpler expression, depending on the operation and the values
of B and C. Signed zeros prevent all of these transformations,