From db21bbf90c02ca0a342e7fd9acdc778b2e758692 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 16 Nov 2006 03:50:16 +0000 Subject: [PATCH] re PR middle-end/29862 (Calling a function with gcc_assert) 2006-11-15 H.J. Lu PR middle-end/29862 * real.c (mpfr_from_real): Call mpfr_set_str before gcc_assert. From-SVN: r118881 --- gcc/ChangeLog | 5 +++++ gcc/real.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d02d73306858..26e5793ccd7e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-11-15 H.J. Lu + + PR middle-end/29862 + * real.c (mpfr_from_real): Call mpfr_set_str before gcc_assert. + 2006-11-15 Paul Brook * config/arm/unwind-arm.c (_Unwind_GetDataRelBase, diff --git a/gcc/real.c b/gcc/real.c index 8c263e0097ba..bfb8462baead 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -4930,11 +4930,13 @@ mpfr_from_real (mpfr_ptr m, const REAL_VALUE_TYPE *r) { /* We use a string as an intermediate type. */ char buf[128]; + int ret; real_to_hexadecimal (buf, r, sizeof (buf), 0, 1); /* mpfr_set_str() parses hexadecimal floats from strings in the same format that GCC will output them. Nothing extra is needed. */ - gcc_assert (mpfr_set_str (m, buf, 16, GMP_RNDN) == 0); + ret = mpfr_set_str (m, buf, 16, GMP_RNDN); + gcc_assert (ret == 0); } /* Convert from MPFR to REAL_VALUE_TYPE. */ -- 2.47.2