diff options
author | Richard Biener <rguenther@suse.de> | 2014-11-06 09:07:39 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-11-06 09:07:39 +0000 |
commit | 5609420fbab5ca93d18219b94eda95779bd75bb2 (patch) | |
tree | e8f63a58ac6d127bfe10b0ea17550a63bc530c20 /gcc/genmatch.c | |
parent | 45ea41fe8a833e4605ce0a1af794530030d483e4 (diff) | |
download | gcc-5609420fbab5ca93d18219b94eda95779bd75bb2.zip gcc-5609420fbab5ca93d18219b94eda95779bd75bb2.tar.gz gcc-5609420fbab5ca93d18219b94eda95779bd75bb2.tar.bz2 |
match.pd: Implement bitwise binary and unary simplifications from tree-ssa-forwprop.c.
2014-11-06 Richard Biener <rguenther@suse.de>
* match.pd: Implement bitwise binary and unary simplifications
from tree-ssa-forwprop.c.
* fold-const.c (fold_unary_loc): Remove them here.
(fold_binary_loc): Likewise.
* tree-ssa-forwprop.c (simplify_not_neg_expr): Remove.
(truth_valued_ssa_name): Likewise.
(lookup_logical_inverted_value): Likewise.
(simplify_bitwise_binary_1): Likewise.
(hoist_conversion_for_bitop_p): Likewise.
(simplify_bitwise_binary_boolean): Likewise.
(simplify_bitwise_binary): Likewise.
(pass_forwprop::execute): Remove calls to simplify_not_neg_expr
and simplify_bitwise_binary.
* genmatch.c (dt_node::append_true_op): Use safe_as_a for parent.
(decision_tree::insert): Also insert non-expressions.
* gcc.dg/tree-ssa/forwprop-28.c: Adjust scanning for the
desired transform.
From-SVN: r217178
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r-- | gcc/genmatch.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 7ceb080..e01f7b3 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -1126,7 +1126,7 @@ dt_node::append_op (operand *op, dt_node *parent, unsigned pos) dt_node * dt_node::append_true_op (dt_node *parent, unsigned pos) { - dt_operand *parent_ = as_a<dt_operand *> (parent); + dt_operand *parent_ = safe_as_a<dt_operand *> (parent); dt_operand *n = new dt_operand (DT_TRUE, 0, 0, parent_, pos); return append_node (n); } @@ -1232,9 +1232,6 @@ at_assert_elm: void decision_tree::insert (struct simplify *s, unsigned pattern_no) { - if (s->match->type != operand::OP_EXPR) - return; - dt_operand **indexes = XCNEWVEC (dt_operand *, s->capture_max + 1); dt_node *p = decision_tree::insert_operand (root, s->match, indexes); p->append_simplify (s, pattern_no, indexes); |