diff options
author | Martin Liska <mliska@suse.cz> | 2019-09-16 16:22:36 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-09-16 14:22:36 +0000 |
commit | ae9c3507829ca139749ac3f9cf4a78707a036d3b (patch) | |
tree | 7638b464e77dcc7c79132b726b28dbfc8aa0f2a4 /gcc/genmatch.c | |
parent | c16504f6eabad7e173e4fbcfacf52820fffcb9ec (diff) | |
download | gcc-ae9c3507829ca139749ac3f9cf4a78707a036d3b.zip gcc-ae9c3507829ca139749ac3f9cf4a78707a036d3b.tar.gz gcc-ae9c3507829ca139749ac3f9cf4a78707a036d3b.tar.bz2 |
Rewrite part of and_comparisons_1 into match.pd.
2019-09-16 Martin Liska <mliska@suse.cz>
* genmatch.c (dt_node::append_simplify): Do not print
warning when we have duplicate patterns belonging
to a same simplify rule.
* gimple-fold.c (and_comparisons_1): Remove matching moved to match.pd.
(maybe_fold_comparisons_from_match_pd): Handle
tcc_comparison as a results.
* match.pd: Handle (X == CST1) && (X OP2 CST2) conditions.
From-SVN: r275750
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r-- | gcc/genmatch.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 2e7bf27..cede432 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -1894,10 +1894,15 @@ dt_node * dt_node::append_simplify (simplify *s, unsigned pattern_no, dt_operand **indexes) { + dt_simplify *s2; dt_simplify *n = new dt_simplify (s, pattern_no, indexes); for (unsigned i = 0; i < kids.length (); ++i) - if (dt_simplify *s2 = dyn_cast <dt_simplify *> (kids[i])) + if ((s2 = dyn_cast <dt_simplify *> (kids[i])) + && (verbose >= 1 + || s->match->location != s2->s->match->location)) { + /* With a nested patters, it's hard to avoid these in order + to keep match.pd rules relatively small. */ warning_at (s->match->location, "duplicate pattern"); warning_at (s2->s->match->location, "previous pattern defined here"); print_operand (s->match, stderr); |