summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 12:05:22 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 12:05:22 +0000
commitcf293d8e5dd9eaa284b5195a4b99ea8390435111 (patch)
tree12c72ff76e36de47de6c4929d10f02eb77001ef3
parent2c7b2f8860794cc9b9cf5eeea9d7dc109c0de3be (diff)
downloadgcc-cf293d8e5dd9eaa284b5195a4b99ea8390435111.tar.gz
2016-01-26 Richard Biener <rguenther@suse.de>
PR middle-end/69467 * match.pd: Guard X * CST CMP 0 pattern with single_use. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232821 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/match.pd5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65b1fb359cf..ca46ff0bfa1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2016-01-26 Richard Biener <rguenther@suse.de>
+ PR middle-end/69467
+ * match.pd: Guard X * CST CMP 0 pattern with single_use.
+
+2016-01-26 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/69452
* tree-ssa-loop-im.c (move_computations_dom_walker): Remove.
(move_computations_dom_walker::before_dom_children): Rename
diff --git a/gcc/match.pd b/gcc/match.pd
index 069d2718399..5f282157012 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1821,12 +1821,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(for cmp (simple_comparison)
scmp (swapped_simple_comparison)
(simplify
- (cmp (mult @0 INTEGER_CST@1) integer_zerop@2)
+ (cmp (mult@3 @0 INTEGER_CST@1) integer_zerop@2)
/* Handle unfolded multiplication by zero. */
(if (integer_zerop (@1))
(cmp @1 @2)
(if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0))
- && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0)))
+ && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0))
+ && single_use (@3))
/* If @1 is negative we swap the sense of the comparison. */
(if (tree_int_cst_sgn (@1) < 0)
(scmp @0 @2)