This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR16107] Convert cos (-x) into cos (x)


Hello!

> Please find attached the patch "pr16107.patch" that converts the pattern:-cos (-x) -> cos (x)
> Please review and let me know if its okay.

+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32 } */

There are no integers in the testcase.

Uros.

+#include <math.h>
+
+double t (double x)
+{
+ x = -x;
+ x = cos (x);
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "-x" "optimized" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]