From: Richard Biener Date: Mon, 15 Dec 2014 13:01:47 +0000 (+0000) Subject: re PR tree-optimization/64295 (ICE: SIGSEGV (infinite recursion) with -frounding... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=249700b5f180c66cab7ea3914db89ac77c6e1e25;p=gcc.git re PR tree-optimization/64295 (ICE: SIGSEGV (infinite recursion) with -frounding-math -funsafe-math-optimizations) 2014-12-15 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6683625fdff..3e3eda67b24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-15 Richard Biener + + 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 PR middle-end/64246 diff --git a/gcc/match.pd b/gcc/match.pd index 4ccb41a2366..083d65f9ee1 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8ed52f96660..a4b8957fd99 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Richard Biener + + PR middle-end/64295 + * gcc.dg/pr64295.c: New testcase. + 2014-12-15 Richard Biener PR middle-end/64246 diff --git a/gcc/testsuite/gcc.dg/pr64295.c b/gcc/testsuite/gcc.dg/pr64295.c new file mode 100644 index 00000000000..4882f3254e4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64295.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O -frounding-math -funsafe-math-optimizations" } */ + +double +f (double g) +{ + return g / 3; +}