More real.c fall out on m68k-elf toolchain.
Richard Henderson
rth@redhat.com
Fri Oct 25 14:58:00 GMT 2002
On Fri, Oct 25, 2002 at 09:36:52PM +0100, Graham Stott wrote:
> /usr/local/src/uberbaum/newlib/libm/math/e_acos.c:109: internal compiler
> error: in ten_to_ptwo, at real.c:2052
Fixed thus.
r~
* real.c (real_to_decimal): If the >1 tens reduction loop results
in a negative exponent, fall into the <1 pten computation.
Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.101
diff -c -p -d -r1.101 real.c
*** real.c 22 Oct 2002 00:17:14 -0000 1.101
--- real.c 25 Oct 2002 21:55:36 -0000
*************** real_to_decimal (str, r_orig, buf_size,
*** 1552,1571 ****
/* Find power of 10. Do this by dividing out 10**2**M when
this is larger than the current remainder. Fill PTEN with
the power of 10 that we compute. */
! m = floor_log2 ((int)(r.exp * M_LOG10_2)) + 1;
! do
{
! const REAL_VALUE_TYPE *ptentwo = ten_to_ptwo (m);
! if (do_compare (&u, ptentwo, 0) >= 0)
{
! do_divide (&u, &u, ptentwo);
! do_multiply (&pten, &pten, ptentwo);
! dec_exp += 1 << m;
}
}
! while (--m >= 0);
}
! else if (cmp_one < 0)
{
int m;
--- 1552,1579 ----
/* Find power of 10. Do this by dividing out 10**2**M when
this is larger than the current remainder. Fill PTEN with
the power of 10 that we compute. */
! if (r.exp > 0)
{
! m = floor_log2 ((int)(r.exp * M_LOG10_2)) + 1;
! do
{
! const REAL_VALUE_TYPE *ptentwo = ten_to_ptwo (m);
! if (do_compare (&u, ptentwo, 0) >= 0)
! {
! do_divide (&u, &u, ptentwo);
! do_multiply (&pten, &pten, ptentwo);
! dec_exp += 1 << m;
! }
}
+ while (--m >= 0);
}
! else
! /* We managed to divide off enough tens in the above reduction
! loop that we've now got a negative exponent. Fall into the
! less-than-one code to compute the proper value for PTEN. */
! cmp_one = -1;
}
! if (cmp_one < 0)
{
int m;
More information about the Gcc-patches
mailing list