summaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorRafael Tsuha <rafael.tsuha@usp.br>2019-10-04 18:34:29 +0000
committerJeff Law <law@gcc.gnu.org>2019-10-04 12:34:29 -0600
commit2066f7951cc4f0b23ddff5abfd2ad2ea4ee90fff (patch)
treeab2ca5ec91831479d810d5601ff37fedbae4dc55 /gcc/match.pd
parent69b35f396ceb22e2e04b4228a6811291621808c1 (diff)
match.pd (sinh (x) / cosh (x)): New simplification rule.
* match.pd (sinh (x) / cosh (x)): New simplification rule. * gcc.dg/sinhovercosh-1.c: New test. From-SVN: r276595
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 23ce376802f..9bd5f3e6475 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -4922,6 +4922,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(rdiv (SIN:s @0) (COS:s @0))
(TAN @0))
+ /* Simplify sinh(x) / cosh(x) -> tanh(x). */
+ (simplify
+ (rdiv (SINH:s @0) (COSH:s @0))
+ (TANH @0))
+
/* Simplify cos(x) / sin(x) -> 1 / tan(x). */
(simplify
(rdiv (COS:s @0) (SIN:s @0))