diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-02-20 23:41:26 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-02-20 23:41:26 +0100 |
commit | b2d6c9e88c22c18b1109bb39f265f64fffdbb901 (patch) | |
tree | bcb70f7063bd66f7d8aa1217e5cf490b3555fb64 /gcc/toplev.c | |
parent | c5a32f1ae9300e3fa4c4d8d59bc178aec6600c19 (diff) | |
download | gcc-b2d6c9e88c22c18b1109bb39f265f64fffdbb901.zip gcc-b2d6c9e88c22c18b1109bb39f265f64fffdbb901.tar.gz gcc-b2d6c9e88c22c18b1109bb39f265f64fffdbb901.tar.bz2 |
re PR tree-optimization/88074 (g++ hangs on math expression)
PR middle-end/88074
PR middle-end/89415
* toplev.c (do_compile): Double the emin/emax exponents to workaround
buggy mpc_norm.
* gcc.dg/pr88074-2.c: New test.
From-SVN: r269055
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index d8096ce..d3719ff 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2173,8 +2173,12 @@ do_compile () max_exp = fmt->emax; } } - if (mpfr_set_emin (min_exp) - || mpfr_set_emax (max_exp)) + /* E.g. mpc_norm assumes it can square a number without bothering with + with range scaling, so until that is fixed, double the minimum + and maximum exponents, plus add some buffer for arithmetics + on the squared numbers. */ + if (mpfr_set_emin (2 * (min_exp - 1)) + || mpfr_set_emax (2 * (max_exp + 1))) sorry ("mpfr not configured to handle all float modes"); /* Set up the back-end if requested. */ |