re PR tree-optimization/64295 (ICE: SIGSEGV (infinite recursion) with -frounding-math -funsafe-math-optimizations)

2014-12-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/64295
	* match.pd (X / CST -> X * (1 / CST): Use const_binop instead of
	fold_binary to compute the constant to multiply with.

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

From-SVN: r218748
This commit is contained in:
Richard Biener 2014-12-15 13:01:47 +00:00 committed by Richard Biener
parent 024660c594
commit 249700b5f1
4 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-12-15 Richard Biener <rguenther@suse.de>
PR middle-end/64295
* match.pd (X / CST -> X * (1 / CST): Use const_binop instead of
fold_binary to compute the constant to multiply with.
2014-12-15 Richard Biener <rguenther@suse.de>
PR middle-end/64246

View File

@ -186,7 +186,7 @@ along with GCC; see the file COPYING3. If not see
(if (flag_reciprocal_math
&& !real_zerop (@1))
(with
{ tree tem = fold_binary (RDIV_EXPR, type, build_one_cst (type), @1); }
{ tree tem = const_binop (RDIV_EXPR, type, build_one_cst (type), @1); }
(if (tem)
(mult @0 { tem; } ))))
(if (cst != COMPLEX_CST)

View File

@ -1,3 +1,8 @@
2014-12-15 Richard Biener <rguenther@suse.de>
PR middle-end/64295
* gcc.dg/pr64295.c: New testcase.
2014-12-15 Richard Biener <rguenther@suse.de>
PR middle-end/64246

View File

@ -0,0 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O -frounding-math -funsafe-math-optimizations" } */
double
f (double g)
{
return g / 3;
}