Commit b2d6c9e8 by Jakub Jelinek Committed by Jakub Jelinek

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
parent c5a32f1a
2019-02-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/88074
PR middle-end/89415
* toplev.c (do_compile): Double the emin/emax exponents to workaround
buggy mpc_norm.
2019-02-20 Uroš Bizjak <ubizjak@gmail.com> 2019-02-20 Uroš Bizjak <ubizjak@gmail.com>
PR target/89397 PR target/89397
......
2019-02-20 Jakub Jelinek <jakub@redhat.com> 2019-02-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/88074
PR middle-end/89415
* gcc.dg/pr88074-2.c: New test.
PR c++/89336 PR c++/89336
* g++.dg/cpp1y/constexpr-89336-3.C: New test. * g++.dg/cpp1y/constexpr-89336-3.C: New test.
......
/* PR middle-end/88074 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-add-options float128 } */
/* { dg-require-effective-target float128 } */
/* { dg-final { scan-tree-dump-not "link_error " "optimized" } } */
extern void link_error (void);
int
main ()
{
if (((__FLT128_MAX__ * 0.5 + __FLT128_MAX__ * 0.5i)
/ (__FLT128_MAX__ * 0.25 + __FLT128_MAX__ * 0.25i))
!= (_Complex _Float128) 2)
link_error ();
return 0;
}
...@@ -2173,8 +2173,12 @@ do_compile () ...@@ -2173,8 +2173,12 @@ do_compile ()
max_exp = fmt->emax; max_exp = fmt->emax;
} }
} }
if (mpfr_set_emin (min_exp) /* E.g. mpc_norm assumes it can square a number without bothering with
|| mpfr_set_emax (max_exp)) 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"); sorry ("mpfr not configured to handle all float modes");
/* Set up the back-end if requested. */ /* Set up the back-end if requested. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment