On 11/27/18 12:38 PM, Giuliano Augusto Faulin Belinassi wrote: > Only do this optimization if funsafe-math and -fno-math-errno are > enabled, as pointed in the previous iteration. > > Also added one more test case to ensure that fno-math-errno is > required for the optimization. > > Special thanks for Wilco Dijsktra for all his help :-) > > gcc/ChangeLog > 2018-11-27 Giuliano Belinassi <giuliano.belina...@usp.br> > > * match.pd (sinh (atanh (x))): New simplification rules. > (cosh (atanh (x))): Likewise. > > gcc/testsuite/ChangeLog > 2018-11-27 Giuliano Belinassi <giuliano.belina...@usp.br> > > * gcc.dg/sinhatanh-1.c: New test. > * gcc.dg/sinhatanh-2.c: New test. > * gcc.dg/sinhatanh-3.c: New test. Arguably you'd want to extend the -2 and -3 tests to verify the number of calls to sinh, cosh and atanh is what you expect. An alternate would be verifying there are no sqrt calls. But I think that can be handled as a follow-up if you wanted to improve the test.
I've installed the patch. THanks for your persistence. This probably took a lot longer than anyone anticipated. jeff