Richi pointed out that SPEC 2006 447.dealII ICEs with a SIGSEGV
because of my recent changes in reassoc.  This patch fixes it.

Bootstrapped/regtested on x86_64-linux, applying to trunk.

2015-10-15  Marek Polacek  <pola...@redhat.com>

        * 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.

diff --git gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c 
gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c
index e69de29..9c8eb39 100644
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-42.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+double
+foo (double f(void))
+{
+  return 2. * f ();
+}
diff --git gcc/tree-ssa-reassoc.c gcc/tree-ssa-reassoc.c
index 62438dd..86cf3e8 100644
--- gcc/tree-ssa-reassoc.c
+++ gcc/tree-ssa-reassoc.c
@@ -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;

        Marek

Reply via email to