re PR c/67107 (ICE: SIGSEGV in tree_class_check with -frounding-math -funsafe-math-optimizations)

2015-08-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/67107
	* match.pd: Guard const_binop result checking against NULL_TREE
	result.

	* gcc.dg/pr67107.c: New testcase.

From-SVN: r226609
This commit is contained in:
Richard Biener 2015-08-05 07:42:54 +00:00 committed by Richard Biener
parent 1e928e07b2
commit f980c9a262
4 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67107
* match.pd: Guard const_binop result checking against NULL_TREE
result.
2015-08-05 Kugan Vivekanandarajah <kuganv@linaro.org>
* cse.c (cse_insn): Restoring old behaviour for src_eqv

View File

@ -1599,7 +1599,7 @@ along with GCC; see the file COPYING3. If not see
tree tem = const_binop (op == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR,
TREE_TYPE (@1), @2, @1);
}
(if (!TREE_OVERFLOW (tem))
(if (tem && !TREE_OVERFLOW (tem))
(cmp @0 { tem; }))))))
/* Likewise, we can simplify a comparison of a real constant with
@ -1610,7 +1610,7 @@ along with GCC; see the file COPYING3. If not see
(simplify
(cmp (minus REAL_CST@0 @1) REAL_CST@2)
(with { tree tem = const_binop (MINUS_EXPR, TREE_TYPE (@1), @0, @2); }
(if (!TREE_OVERFLOW (tem))
(if (tem && !TREE_OVERFLOW (tem))
(cmp { tem; } @1)))))
/* Fold comparisons against built-in math functions. */

View File

@ -1,3 +1,8 @@
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67107
* gcc.dg/pr67107.c: New testcase.
2015-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/66197

View File

@ -0,0 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-frounding-math -funsafe-math-optimizations" } */
int test ()
{
return 5.0 < 5.0 - 0.1;
}