aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-02-01 15:40:23 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-02-01 15:40:23 +0000
commitff86345f836c265d6bbb8d1bee5417e6f4c32ac9 (patch)
tree34d167906d80905ebb683f3569c2ebae20298c70 /gcc/match.pd
parentbc369dbd3f4a3290bc6e6e42892e47a90dc34f4f (diff)
downloadgcc-ff86345f836c265d6bbb8d1bee5417e6f4c32ac9.zip
gcc-ff86345f836c265d6bbb8d1bee5417e6f4c32ac9.tar.gz
gcc-ff86345f836c265d6bbb8d1bee5417e6f4c32ac9.tar.bz2
re PR tree-optimization/69556 (forwprop4/match.pd undoing work from recip)
2016-02-01 Richard Biener <rguenther@suse.de> PR middle-end/69556 * match.pd: Guard (C1/X)*C2 -> (C1*C2)/X with single_use. * gcc.dg/tree-ssa/recip-8.c: New testcase. From-SVN: r233040
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 6313411..491f769 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -445,8 +445,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* Fold (C1/X)*C2 into (C1*C2)/X. */
(simplify
- (mult (rdiv:s REAL_CST@0 @1) REAL_CST@2)
- (if (flag_associative_math)
+ (mult (rdiv@3 REAL_CST@0 @1) REAL_CST@2)
+ (if (flag_associative_math
+ && single_use (@3))
(with
{ tree tem = const_binop (MULT_EXPR, type, @0, @2); }
(if (tem)