summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 12:49:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 12:49:58 +0000
commiteadb4d2f91e15d75cec8dfb9447ce63a0c5821e8 (patch)
tree6ecda2e36f59655af88a3d7c0521fb193010349e
parenta8876617811b8999e71d100cdd682b4e76c04b67 (diff)
downloadgcc-eadb4d2f91e15d75cec8dfb9447ce63a0c5821e8.tar.gz
2016-04-20 Richard Biener <rguenther@suse.de>
* gimple-match.h (maybe_build_generic_op): Adjust prototype. * gimple-match-head.c (maybe_build_generic_op): Pass all ops by reference, clear op1 and op2 when GENERICizing BIT_FIELD_REF. (maybe_push_res_to_seq): Adjust. * gimple-fold.c (maybe_build_generic_op): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235274 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple-fold.c3
-rw-r--r--gcc/gimple-match-head.c10
-rw-r--r--gcc/gimple-match.h2
4 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1e8a33b9b13..e61f98c2df4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2016-04-20 Richard Biener <rguenther@suse.de>
+
+ * gimple-match.h (maybe_build_generic_op): Adjust prototype.
+ * gimple-match-head.c (maybe_build_generic_op): Pass all ops
+ by reference, clear op1 and op2 when GENERICizing BIT_FIELD_REF.
+ (maybe_push_res_to_seq): Adjust.
+ * gimple-fold.c (maybe_build_generic_op): Likewise.
+
2016-04-20 Marek Polacek <polacek@redhat.com>
* tree-if-conv.c (is_false_predicate): For NULL_TREE return false
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index eb130d04846..6cd0a4b8f53 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -3376,8 +3376,7 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi,
|| gimple_num_ops (stmt) > get_gimple_rhs_num_ops (rcode))
{
maybe_build_generic_op (rcode,
- TREE_TYPE (gimple_assign_lhs (stmt)),
- &ops[0], ops[1], ops[2]);
+ TREE_TYPE (gimple_assign_lhs (stmt)), ops);
gimple_assign_set_rhs_with_ops (gsi, rcode, ops[0], ops[1], ops[2]);
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index c86a4ffb0e3..2beadbc2905 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -233,18 +233,18 @@ gimple_resimplify3 (gimple_seq *seq,
a GENERIC tree for that expression into *OP0. */
void
-maybe_build_generic_op (enum tree_code code, tree type,
- tree *op0, tree op1, tree op2)
+maybe_build_generic_op (enum tree_code code, tree type, tree *ops)
{
switch (code)
{
case REALPART_EXPR:
case IMAGPART_EXPR:
case VIEW_CONVERT_EXPR:
- *op0 = build1 (code, type, *op0);
+ ops[0] = build1 (code, type, ops[0]);
break;
case BIT_FIELD_REF:
- *op0 = build3 (code, type, *op0, op1, op2);
+ ops[0] = build3 (code, type, ops[0], ops[1], ops[2]);
+ ops[1] = ops[2] = NULL_TREE;
break;
default:;
}
@@ -316,7 +316,7 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops,
else
res = create_tmp_reg (type);
}
- maybe_build_generic_op (rcode, type, &ops[0], ops[1], ops[2]);
+ maybe_build_generic_op (rcode, type, ops);
gimple *new_stmt = gimple_build_assign (res, rcode,
ops[0], ops[1], ops[2]);
gimple_seq_add_stmt_without_update (seq, new_stmt);
diff --git a/gcc/gimple-match.h b/gcc/gimple-match.h
index 219b5decd55..2b8f4b96888 100644
--- a/gcc/gimple-match.h
+++ b/gcc/gimple-match.h
@@ -64,7 +64,7 @@ bool gimple_resimplify3 (gimple_seq *, code_helper *, tree, tree *,
tree (*)(tree));
tree maybe_push_res_to_seq (code_helper, tree, tree *,
gimple_seq *, tree res = NULL_TREE);
-void maybe_build_generic_op (enum tree_code, tree, tree *, tree, tree);
+void maybe_build_generic_op (enum tree_code, tree, tree *);
#endif /* GCC_GIMPLE_MATCH_H */