tree-ssa-reassoc.c (attempt_builtin_copysign): Call gimple_call_builtin instead of...
authorMarek Polacek <polacek@redhat.com>
Thu, 15 Oct 2015 13:22:47 +0000 (13:22 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 15 Oct 2015 13:22:47 +0000 (13:22 +0000)
* tree-ssa-reassoc.c (attempt_builtin_copysign): Call
gimple_call_builtin instead of is_gimple_call.

* gcc.dg/tree-ssa/reassoc-42.c: New test.

From-SVN: r228843

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index 380f1eed379484e874386d009764970fac7a5c9e..50c7f57e40f1e88b31f5597a5acc3b81a61279b9 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-15  Marek Polacek  <polacek@redhat.com>
+
+       * tree-ssa-reassoc.c (attempt_builtin_copysign): Call
+       gimple_call_builtin instead of is_gimple_call.
+
 2015-10-15  Richard Biener  <rguenther@suse.de>
 
        * tree-vect-stmts.c (vect_init_vector): Remove unused vars.
index 631d8a7b613914909831882c3faf6f1b68b511b9..181e5e482e01174a8e1a899f1cfaa668a165c310 100644 (file)
@@ -1,3 +1,7 @@
+2015-10-15  Marek Polacek  <polacek@redhat.com>
+
+       * gcc.dg/tree-ssa/reassoc-42.c: New test.
+
 2015-10-15  Marek Polacek  <polacek@redhat.com>
 
        PR tree-optimization/67953
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c
new file mode 100644 (file)
index 0000000..9c8eb39
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+double
+foo (double f(void))
+{
+  return 2. * f ();
+}
index 62438dd702786aaf8d197dd4ea1e27897c13f22e..45b8d467d4855eb4ee472b7694dc6fb05dfa853e 100644 (file)
@@ -4643,7 +4643,7 @@ attempt_builtin_copysign (vec<operand_entry *> *ops)
          && has_single_use (oe->op))
        {
          gimple *def_stmt = SSA_NAME_DEF_STMT (oe->op);
-         if (is_gimple_call (def_stmt))
+         if (gimple_call_builtin_p (def_stmt, BUILT_IN_NORMAL))
            {
              tree fndecl = gimple_call_fndecl (def_stmt);
              tree arg0, arg1;