]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/69070 (ICE: tree check: expected real_cst, have ssa_name...
authorJakub Jelinek <jakub@redhat.com>
Fri, 1 Jan 2016 11:55:59 +0000 (12:55 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 1 Jan 2016 11:55:59 +0000 (12:55 +0100)
PR tree-optimization/69070
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Only test
REAL_VALUE_ISSIGNALING_NAN on arg0 if arg0 is a REAL_CST.

* gcc.dg/pr69070.c: New test.

From-SVN: r232025

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr69070.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c

index 8f67593969f80de1518a5f7263df5b48bc2283f5..7d27a83413055c85dbe3892139c03f1742ac6898 100644 (file)
@@ -1,5 +1,9 @@
 2016-01-01  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/69070
+       * tree-ssa-math-opts.c (gimple_expand_builtin_pow): Only test
+       REAL_VALUE_ISSIGNALING_NAN on arg0 if arg0 is a REAL_CST.
+
        PR sanitizer/69055
        * ubsan.c (ubsan_instrument_float_cast): Call
        initialize_sanitizer_builtins.
index 3de98fbbca156944b11161bfe8c6981944d8df78..e189d4b838aa83029af730ee499be325f882c0dc 100644 (file)
@@ -1,5 +1,8 @@
 2016-01-01  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/69070
+       * gcc.dg/pr69070.c: New test.
+
        PR sanitizer/69055
        * gfortran.dg/pr69055.f90: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr69070.c b/gcc/testsuite/gcc.dg/pr69070.c
new file mode 100644 (file)
index 0000000..f8a82e5
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR tree-optimization/69070 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsignaling-nans" } */
+
+double
+foo (double d)
+{
+  return __builtin_pow (d, 2);
+}
index 244cf196277778ad1acef403a8cd58ec4481cd99..5cb8ba2275c8cb6bd5497fd7e11ed0b3780af368 100644 (file)
@@ -1538,7 +1538,8 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
   /* Don't perform the operation if flag_signaling_nans is on
      and the operand is a signaling NaN.  */
   if (HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg1)))
-      && (REAL_VALUE_ISSIGNALING_NAN (TREE_REAL_CST (arg0))
+      && ((TREE_CODE (arg0) == REAL_CST
+          && REAL_VALUE_ISSIGNALING_NAN (TREE_REAL_CST (arg0)))
          || REAL_VALUE_ISSIGNALING_NAN (TREE_REAL_CST (arg1))))
     return NULL_TREE;