diff options
author | Richard Biener <rguenther@suse.de> | 2014-12-15 13:01:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-12-15 13:01:47 +0000 |
commit | 249700b5f180c66cab7ea3914db89ac77c6e1e25 (patch) | |
tree | 8ec6e02620a39d9d92b51c578294be9d51965088 | |
parent | 024660c5942a95a54712adc9e91953ca83081c07 (diff) | |
download | gcc-249700b5f180c66cab7ea3914db89ac77c6e1e25.zip gcc-249700b5f180c66cab7ea3914db89ac77c6e1e25.tar.gz gcc-249700b5f180c66cab7ea3914db89ac77c6e1e25.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/match.pd | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr64295.c | 8 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6683625..3e3eda6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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 * cfgloop.c (mark_loop_for_removal): Make safe against multiple invocations on the same loop. diff --git a/gcc/match.pd b/gcc/match.pd index 4ccb41a..083d65f 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 8ed52f9..a4b8957 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 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 * gnat.dg/opt46.adb: New testcase. * gnat.dg/opt46.ads: Likewise. diff --git a/gcc/testsuite/gcc.dg/pr64295.c b/gcc/testsuite/gcc.dg/pr64295.c new file mode 100644 index 0000000..4882f32 --- /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; +} |