This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR16107] Convert cos (-x) into cos (x)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at caviumnetworks dot com>
- Date: Fri, 7 Aug 2015 10:55:47 +0200
- Subject: Re: [PR16107] Convert cos (-x) into cos (x)
- Authentication-results: sourceware.org; auth=none
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" } } */