re PR tree-optimization/69070 (ICE: tree check: expected real_cst, have ssa_name in gimple_expand_builtin_pow, at tree-ssa-math-opts.c:1541 with -fsignaling-nans and powl())

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
This commit is contained in:
Jakub Jelinek 2016-01-01 12:55:59 +01:00 committed by Jakub Jelinek
parent 10dff63f98
commit 942a13194f
4 changed files with 18 additions and 1 deletions

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

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

View File

@ -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);
}

View 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;