From b2d6c9e88c22c18b1109bb39f265f64fffdbb901 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 20 Feb 2019 23:41:26 +0100 Subject: 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 --- gcc/toplev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/toplev.c') 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. */ -- cgit v1.1