aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-06-29 11:28:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-06-29 11:28:17 +0000
commit99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a (patch)
treede2d1287b43d96691cfb42c5e3a59e13f9cf3696 /gcc/genmatch.c
parent2dcaddb8d74e3ec30edb264b845a346e0b7e9ab9 (diff)
downloadgcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.zip
gcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.tar.gz
gcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.tar.bz2
genmatch.c (add_operator): Treat ADDR_EXPR as atom.
2015-06-29 Richard Biener <rguenther@suse.de> * genmatch.c (add_operator): Treat ADDR_EXPR as atom. * fold-const.c (fold_binary_loc): Move &A - &B simplification via ptr_difference_const ... * match.pd: ... here. When matching (X ^ Y) == Y also match with swapped operands. From-SVN: r225115
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 195dc3c..2bd61d3 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -324,6 +324,9 @@ add_operator (enum tree_code code, const char *id,
/* And allow CONSTRUCTOR for vector initializers. */
&& !(code == CONSTRUCTOR))
return;
+ /* Treat ADDR_EXPR as atom, thus don't allow matching its operand. */
+ if (code == ADDR_EXPR)
+ nargs = 0;
operator_id *op = new operator_id (code, id, nargs, tcc);
id_base **slot = operators->find_slot_with_hash (op, op->hashval, INSERT);
if (*slot)