This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ICE compiling newlib-1.8.0 with egcs-19990117
- To: egcs-bugs at cygnus dot com
- Subject: ICE compiling newlib-1.8.0 with egcs-19990117
- From: Scott Howard <scott at objsw dot com>
- Date: Wed, 27 Jan 1999 23:55:03 -0800
- Organization: Object Software, Inc.
This happened while compiling newlib for an sh-unknown-coff target on an
i586-pc-linux-gnu system. The OS is Redhat 5.1 on a Cyrix 233MX with 32
MB RAM.
make[5]: Entering directory
`/home/xgcc/build2/b-dos-x-sh3/sh3/m4-single-only/newlib/libc/stdlib'
/home/xgcc/build2/b-i586-linux-x-sh3/gcc/xgcc
-B/home/xgcc/build2/b-i586-linux-x-sh3/gcc/ -isystem
/home/xgcc/build2/src/winsup/include -isystem
/home/xgcc/build2/b-i586-linux-x-sh3/sh3/newlib/targ-include -isystem
/home/xgcc/build2/src/newlib/libc/include -O2 -v --save-temps
-m4-single-only -O2 -DMISSING_SYSCALL_NAMES -fno-builtin
-I/home/xgcc/build2/b-dos-x-sh3/sh3/newlib/./targ-include
-I/home/xgcc/build2/src/newlib/./libc/include -c
/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c
Reading specs from /home/xgcc/build2/b-i586-linux-x-sh3/gcc/specs
gcc version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental)
/home/xgcc/build2/b-i586-linux-x-sh3/gcc/cpp -lang-c -v
-I/home/xgcc/build2/b-dos-x-sh3/sh3/newlib/./targ-include
-I/home/xgcc/build2/src/newlib/./libc/include -isystem
/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include -undef -D__GNUC__=2
-D__GNUC_MINOR__=93 -D__sh__ -D__sh__ -Acpu(sh) -Amachine(sh)
-D__OPTIMIZE__ -D__SH4_SINGLE_ONLY__ -DMISSING_SYSCALL_NAMES -isystem
/home/xgcc/build2/src/winsup/include -isystem
/home/xgcc/build2/b-i586-linux-x-sh3/sh3/newlib/targ-include -isystem
/home/xgcc/build2/src/newlib/libc/include
/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c dtoa.i
GNU CPP version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental)
(Hitachi SH)
#include "..." search starts here:
#include <...> search starts here:
/home/xgcc/build2/b-dos-x-sh3/sh3/newlib/targ-include
/home/xgcc/build2/src/newlib/libc/include
/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include
/home/xgcc/build2/src/newlib/libc/include
End of search list.
/home/xgcc/build2/b-i586-linux-x-sh3/gcc/cc1 dtoa.i -quiet -dumpbase
dtoa.c -m4-single-only -O2 -O2 -version -fno-builtin -o dtoa.s
GNU C version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental) (sh3)
compiled by GNU C version 2.7.2.3.
/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c: In function `_dtoa_r':
/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c:851: internal
error--unrecognizable insn:
(insn 2814 2721 2820 (set:SF (reg/v:SF 570)
(mem:SF (reg:SI 14 r14) 4)) -1 (nil)
(nil))
/home/xgcc/build2/src/gcc/toplev.c:1397: Internal compiler error in
function fatal_insn
Please submit a full bug report to `egcs-bugs@cygnus.com'.
See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
make[5]: *** [dtoa.o] Error 1
# 1 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c"
# 1 "/home/xgcc/build2/src/newlib/libc/include/_ansi.h" 1 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/sys/config.h" 1 3
# 14 "/home/xgcc/build2/src/newlib/libc/include/sys/config.h" 3
# 25 "/home/xgcc/build2/src/newlib/libc/include/sys/config.h" 3
# 44 "/home/xgcc/build2/src/newlib/libc/include/sys/config.h" 3
# 69 "/home/xgcc/build2/src/newlib/libc/include/sys/config.h" 3
typedef int __int32_t;
typedef unsigned int __uint32_t;
# 15 "/home/xgcc/build2/src/newlib/libc/include/_ansi.h" 2 3
# 61 "/home/xgcc/build2/src/newlib/libc/include/_ansi.h" 3
# 29 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c" 2
# 1 "/home/xgcc/build2/src/newlib/libc/include/stdlib.h" 1 3
# 1 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 1 3
# 19 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 61 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 131 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
typedef unsigned int size_t;
typedef short unsigned int wchar_t;
# 283 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 317 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 17 "/home/xgcc/build2/src/newlib/libc/include/stdlib.h" 2 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/sys/reent.h" 1 3
struct _glue
{
struct _glue *_next;
int _niobs;
struct __sFILE *_iobs;
};
struct _Bigint
{
struct _Bigint *_next;
int _k, _maxwds, _sign, _wds;
unsigned long _x[1];
};
struct _atexit {
struct _atexit *_next;
int _ind;
void (*_fns[32 ])();
};
struct __sbuf {
unsigned char *_base;
int _size;
};
typedef long _fpos_t;
struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void * _cookie;
int (*_read) (void * _cookie, char *_buf, int _n) ;
int (*_write) (void * _cookie, const char *_buf, int _n) ;
_fpos_t (*_seek) (void * _cookie, _fpos_t _offset, int _whence) ;
int (*_close) (void * _cookie) ;
struct __sbuf _ub;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
int _offset;
struct _reent *_data;
};
struct _reent
{
int _errno;
struct __sFILE *_stdin, *_stdout, *_stderr;
int _inc;
char _emergency[25];
int _current_category;
const char *_current_locale;
int __sdidinit;
void (*__cleanup) (struct _reent *) ;
struct _Bigint *_result;
int _result_k;
struct _Bigint *_p5s;
struct _Bigint **_freelist;
int _cvtlen;
char *_cvtbuf;
unsigned char * _nextf[30 ];
unsigned int _nmalloc[30 ];
struct _atexit *_atexit;
struct _atexit _atexit0;
void (**(_sig_func))();
struct _glue __sglue;
struct __sFILE __sf[3];
};
extern struct _reent *_impure_ptr ;
void _reclaim_reent (struct _reent *) ;
# 19 "/home/xgcc/build2/src/newlib/libc/include/stdlib.h" 2 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
void abort (void ) __attribute__ ( (noreturn) ) ;
int abs (int) ;
int atexit (void (*_func)(void )) ;
double atof (const char *_nptr) ;
float atoff (const char *_nptr) ;
int atoi (const char *_nptr) ;
long atol (const char *_nptr) ;
void * bsearch (const void * _key,
const void * _base,
size_t _nmemb,
size_t _size,
int (*_compar) (const void * , const void * ) ) ;
void * calloc (size_t _nmemb, size_t _size) ;
div_t div (int _numer, int _denom) ;
void exit (int _status) __attribute__ ( (noreturn) ) ;
void free (void * ) ;
char * getenv (const char *_string) ;
long labs (long) ;
ldiv_t ldiv (long _numer, long _denom) ;
void * malloc (size_t _size) ;
int mblen (const char *, size_t) ;
int mbtowc (wchar_t *, const char *, size_t) ;
int wctomb (char *, wchar_t) ;
size_t mbstowcs (wchar_t *, const char *, size_t) ;
size_t wcstombs (char *, const wchar_t *, size_t) ;
void qsort (void * _base, size_t _nmemb, size_t _size, int(*_compar)(const void * , const void * )) ;
int rand (void ) ;
void * realloc (void * _r, size_t _size) ;
void srand (unsigned _seed) ;
double strtod (const char *_n, char **_end_PTR) ;
float strtodf (const char *_n, char **_end_PTR) ;
long strtol (const char *_n, char **_end_PTR, int _base) ;
unsigned long strtoul (const char *_n_PTR, char **_end_PTR, int _base) ;
unsigned long _strtoul_r (struct _reent *,const char *_n_PTR, char **_end_PTR, int _base) ;
int system (const char *_string) ;
void cfree (void * , void * ) ;
int putenv (const char *_string) ;
int setenv (const char *_string, const char *_value, int _overwrite) ;
char * gcvt (double,int,char *) ;
char * gcvtf (float,int,char *) ;
char * fcvt (double,int,int *,int *) ;
char * fcvtf (float,int,int *,int *) ;
char * ecvt (double,int,int *,int *) ;
char * ecvtbuf (double, int, int*, int*, char *) ;
char * fcvtbuf (double, int, int*, int*, char *) ;
char * ecvtf (float,int,int *,int *) ;
char * dtoa (double, int, int, int *, int*, char**) ;
int rand_r (unsigned *_seed) ;
char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**) ;
void * _malloc_r (struct _reent *, size_t) ;
void * _calloc_r (struct _reent *, size_t, size_t) ;
void _free_r (struct _reent *, void * ) ;
void * _realloc_r (struct _reent *, void * , size_t) ;
void _mstats_r (struct _reent *, char *) ;
int _system_r (struct _reent *, const char *) ;
void __eprintf (const char *, const char *, unsigned int, const char *) ;
# 30 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c" 2
# 1 "/home/xgcc/build2/src/newlib/libc/include/reent.h" 1 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/sys/_types.h" 1 3
typedef long _off_t;
typedef long _ssize_t;
# 49 "/home/xgcc/build2/src/newlib/libc/include/reent.h" 2 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/machine/types.h" 1 3
# 50 "/home/xgcc/build2/src/newlib/libc/include/reent.h" 2 3
# 1 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 1 3
# 19 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 61 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 131 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 188 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 271 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 283 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 317 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 53 "/home/xgcc/build2/src/newlib/libc/include/reent.h" 2 3
struct stat;
struct tms;
struct timeval;
struct timezone;
extern int _close_r (struct _reent *, int) ;
extern int _fcntl_r (struct _reent *, int, int, int) ;
extern int _fork_r (struct _reent *) ;
extern int _fstat_r (struct _reent *, int, struct stat *) ;
extern int _getpid_r (struct _reent *) ;
extern int _kill_r (struct _reent *, int, int) ;
extern int _link_r (struct _reent *, const char *, const char *) ;
extern _off_t _lseek_r (struct _reent *, int, _off_t, int) ;
extern int _open_r (struct _reent *, const char *, int, int) ;
extern _ssize_t _read_r (struct _reent *, int, void *, size_t) ;
extern void *_sbrk_r (struct _reent *, size_t) ;
extern int _stat_r (struct _reent *, const char *, struct stat *) ;
extern unsigned long _times_r (struct _reent *, struct tms *) ;
extern int _unlink_r (struct _reent *, const char *) ;
extern int _wait_r (struct _reent *, int *) ;
extern _ssize_t _write_r (struct _reent *, int, const void *, size_t) ;
extern int _gettimeofday_r (struct _reent *, struct timeval *tp, struct timezone *tzp) ;
# 31 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c" 2
# 1 "/home/xgcc/build2/src/newlib/libc/include/string.h" 1 3
# 1 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 1 3
# 19 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 61 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 131 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 188 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 271 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 283 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 317 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/stddef.h" 3
# 17 "/home/xgcc/build2/src/newlib/libc/include/string.h" 2 3
void * memchr (const void * , int, size_t) ;
int memcmp (const void * , const void * , size_t) ;
void * memcpy (void * , const void * , size_t) ;
void * memmove (void * , const void * , size_t) ;
void * memset (void * , int, size_t) ;
char * strcat (char *, const char *) ;
char * strchr (const char *, int) ;
int strcmp (const char *, const char *) ;
int strcoll (const char *, const char *) ;
char * strcpy (char *, const char *) ;
size_t strcspn (const char *, const char *) ;
char * strerror (int) ;
size_t strlen (const char *) ;
char * strncat (char *, const char *, size_t) ;
int strncmp (const char *, const char *, size_t) ;
char * strncpy (char *, const char *, size_t) ;
char * strpbrk (const char *, const char *) ;
char * strrchr (const char *, int) ;
size_t strspn (const char *, const char *) ;
char * strstr (const char *, const char *) ;
int ffs (int) ;
char * strtok (char *, const char *) ;
size_t strxfrm (char *, const char *, size_t) ;
char * strtok_r (char *, const char *, char **) ;
int bcmp (const char *, const char *, size_t) ;
void bcopy (const char *, char *, size_t) ;
void bzero (char *, size_t) ;
int ffs (int) ;
char * index (const char *, int) ;
void * memccpy (void * , const void * , int, size_t) ;
char * rindex (const char *, int) ;
int strcasecmp (const char *, const char *) ;
char * strdup (const char *) ;
int strncasecmp (const char *, const char *, size_t) ;
char * strsep (char **, const char *) ;
char * strlwr (char *) ;
char * strupr (char *) ;
# 32 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c" 2
# 1 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h" 1
# 1 "/home/xgcc/build2/src/newlib/libc/include/ieeefp.h" 1 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/machine/ieeefp.h" 1 3
# 115 "/home/xgcc/build2/src/newlib/libc/include/machine/ieeefp.h" 3
# 6 "/home/xgcc/build2/src/newlib/libc/include/ieeefp.h" 2 3
typedef union
{
double value;
struct
{
unsigned int sign : 1;
unsigned int exponent: 11;
unsigned int fraction0:4;
unsigned int fraction1:16;
unsigned int fraction2:16;
unsigned int fraction3:16;
} number;
struct
{
unsigned int sign : 1;
unsigned int exponent: 11;
unsigned int quiet:1;
unsigned int function0:3;
unsigned int function1:16;
unsigned int function2:16;
unsigned int function3:16;
} nan;
struct
{
unsigned long msw;
unsigned long lsw;
} parts;
long aslong[2];
} __ieee_double_shape_type;
# 93 "/home/xgcc/build2/src/newlib/libc/include/ieeefp.h" 3
typedef union
{
float value;
struct
{
unsigned int sign : 1;
unsigned int exponent: 8;
unsigned int fraction0: 7;
unsigned int fraction1: 16;
} number;
struct
{
unsigned int sign:1;
unsigned int exponent:8;
unsigned int quiet:1;
unsigned int function0:6;
unsigned int function1:16;
} nan;
long p1;
} __ieee_float_shape_type;
# 145 "/home/xgcc/build2/src/newlib/libc/include/ieeefp.h" 3
typedef int fp_rnd;
fp_rnd fpgetround (void) ;
fp_rnd fpsetround (fp_rnd) ;
typedef int fp_except;
fp_except fpgetmask (void) ;
fp_except fpsetmask (fp_except) ;
fp_except fpgetsticky (void) ;
fp_except fpsetsticky (fp_except) ;
typedef int fp_rdi;
fp_rdi fpgetroundtoi (void) ;
fp_rdi fpsetroundtoi (fp_rdi) ;
int isnan (double) ;
int isinf (double) ;
int finite (double) ;
int isnanf (float) ;
int isinff (float) ;
int finitef (float) ;
# 239 "/home/xgcc/build2/src/newlib/libc/include/ieeefp.h" 3
# 29 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h" 2
# 1 "/home/xgcc/build2/src/newlib/libc/include/math.h" 1 3
union __dmath
{
__uint32_t i[2];
double d;
};
extern const union __dmath __infinity;
extern double atan (double) ;
extern double cos (double) ;
extern double sin (double) ;
extern double tan (double) ;
extern double tanh (double) ;
extern double frexp (double, int *) ;
extern double modf (double, double *) ;
extern double ceil (double) ;
extern double fabs (double) ;
extern double floor (double) ;
extern double acos (double) ;
extern double asin (double) ;
extern double atan2 (double, double) ;
extern double cosh (double) ;
extern double sinh (double) ;
extern double exp (double) ;
extern double ldexp (double, int) ;
extern double log (double) ;
extern double log10 (double) ;
extern double pow (double, double) ;
extern double sqrt (double) ;
extern double fmod (double, double) ;
extern double infinity (void) ;
extern double nan (void) ;
extern int isnan (double) ;
extern int isinf (double) ;
extern int finite (double) ;
extern double copysign (double, double) ;
extern int ilogb (double) ;
extern double asinh (double) ;
extern double cbrt (double) ;
extern double nextafter (double, double) ;
extern double rint (double) ;
extern double scalbn (double, int) ;
extern double log1p (double) ;
extern double expm1 (double) ;
extern double acosh (double) ;
extern double atanh (double) ;
extern double remainder (double, double) ;
extern double gamma (double) ;
extern double gamma_r (double, int *) ;
extern double lgamma (double) ;
extern double lgamma_r (double, int *) ;
extern double erf (double) ;
extern double erfc (double) ;
extern double y0 (double) ;
extern double y1 (double) ;
extern double yn (int, double) ;
extern double j0 (double) ;
extern double j1 (double) ;
extern double jn (int, double) ;
extern double hypot (double, double) ;
extern double cabs();
extern double drem (double, double) ;
extern float atanf (float) ;
extern float cosf (float) ;
extern float sinf (float) ;
extern float tanf (float) ;
extern float tanhf (float) ;
extern float frexpf (float, int *) ;
extern float modff (float, float *) ;
extern float ceilf (float) ;
extern float fabsf (float) ;
extern float floorf (float) ;
extern float acosf (float) ;
extern float asinf (float) ;
extern float atan2f (float, float) ;
extern float coshf (float) ;
extern float sinhf (float) ;
extern float expf (float) ;
extern float ldexpf (float, int) ;
extern float logf (float) ;
extern float log10f (float) ;
extern float powf (float, float) ;
extern float sqrtf (float) ;
extern float fmodf (float, float) ;
extern float infinityf (void) ;
extern float nanf (void) ;
extern int isnanf (float) ;
extern int isinff (float) ;
extern int finitef (float) ;
extern float copysignf (float, float) ;
extern int ilogbf (float) ;
extern float asinhf (float) ;
extern float cbrtf (float) ;
extern float nextafterf (float, float) ;
extern float rintf (float) ;
extern float scalbnf (float, int) ;
extern float log1pf (float) ;
extern float expm1f (float) ;
extern float acoshf (float) ;
extern float atanhf (float) ;
extern float remainderf (float, float) ;
extern float gammaf (float) ;
extern float gammaf_r (float, int *) ;
extern float lgammaf (float) ;
extern float lgammaf_r (float, int *) ;
extern float erff (float) ;
extern float erfcf (float) ;
extern float y0f (float) ;
extern float y1f (float) ;
extern float ynf (int, float) ;
extern float j0f (float) ;
extern float j1f (float) ;
extern float jnf (int, float) ;
extern float hypotf (float, float) ;
extern float cabsf();
extern float dremf (float, float) ;
extern int signgam;
struct exception
{
int type;
char *name;
double arg1;
double arg2;
double retval;
int err;
};
extern int matherr (struct exception *e) ;
enum __fdlibm_version
{
__fdlibm_ieee = -1,
__fdlibm_svid,
__fdlibm_xopen,
__fdlibm_posix
};
extern enum __fdlibm_version __fdlib_version ;
# 30 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h" 2
# 1 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/float.h" 1 3
# 100 "/home/xgcc/build2/b-i586-linux-x-sh3/gcc/include/float.h" 3
# 31 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h" 2
# 1 "/home/xgcc/build2/src/newlib/libc/include/errno.h" 1 3
# 1 "/home/xgcc/build2/src/newlib/libc/include/sys/errno.h" 1 3
extern int *__errno (void) ;
# 1 "/home/xgcc/build2/src/newlib/libc/include/errno.h" 2 3
# 32 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h" 2
# 126 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h"
# 208 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h"
# 222 "/home/xgcc/build2/src/newlib/libc/stdlib/mprec.h"
typedef struct _Bigint _Bigint;
struct _reent ;
double _ulp (double x) ;
double _b2d (_Bigint *a , int *e) ;
_Bigint * _Balloc (struct _reent *p, int k) ;
void _Bfree (struct _reent *p, _Bigint *v) ;
_Bigint * _multadd (struct _reent *p, _Bigint *, int, int) ;
_Bigint * _s2b (struct _reent *, const char*, int, int, unsigned long) ;
_Bigint * _i2b (struct _reent *,int) ;
_Bigint * _mult (struct _reent *, _Bigint *, _Bigint *) ;
_Bigint * _pow5mult (struct _reent *, _Bigint *, int k) ;
int _hi0bits (unsigned long) ;
int _lo0bits (unsigned long *) ;
_Bigint * _d2b (struct _reent *p, double d, int *e, int *bits) ;
_Bigint * _lshift (struct _reent *p, _Bigint *b, int k) ;
_Bigint * __mdiff (struct _reent *p, _Bigint *a, _Bigint *b) ;
int __mcmp (_Bigint *a, _Bigint *b) ;
double _ratio (_Bigint *a, _Bigint *b) ;
extern const double __mprec_tinytens [];
extern const double __mprec_bigtens [];
extern const double __mprec_tens [];
double _mprec_log10 (int) ;
# 33 "/home/xgcc/build2/src/newlib/libc/stdlib/dtoa.c" 2
static int
quorem (
_Bigint * b , _Bigint * S )
{
int n;
long borrow, y;
unsigned long carry, q, ys;
unsigned long *bx, *bxe, *sx, *sxe;
long z;
unsigned long si, zs;
n = S->_wds;
if (b->_wds < n)
return 0;
sx = S->_x;
sxe = sx + --n;
bx = b->_x;
bxe = bx + n;
q = *bxe / (*sxe + 1);
if (q)
{
borrow = 0;
carry = 0;
do
{
si = *sx++;
ys = (si & 0xffff) * q + carry;
zs = (si >> 16) * q + (ys >> 16);
carry = zs >> 16;
y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
borrow = y >> 16;
;
z = (*bx >> 16) - (zs & 0xffff) + borrow;
borrow = z >> 16;
;
(((unsigned short *) bx )[0] = (unsigned short) z , ((unsigned short *) bx )[1] = (unsigned short) y , bx ++) ;
}
while (sx <= sxe);
if (!*bxe)
{
bx = b->_x;
while (--bxe > bx && !*bxe)
--n;
b->_wds = n;
}
}
if (__mcmp (b, S) >= 0)
{
q++;
borrow = 0;
carry = 0;
bx = b->_x;
sx = S->_x;
do
{
si = *sx++;
ys = (si & 0xffff) + carry;
zs = (si >> 16) + (ys >> 16);
carry = zs >> 16;
y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
borrow = y >> 16;
;
z = (*bx >> 16) - (zs & 0xffff) + borrow;
borrow = z >> 16;
;
(((unsigned short *) bx )[0] = (unsigned short) z , ((unsigned short *) bx )[1] = (unsigned short) y , bx ++) ;
}
while (sx <= sxe);
bx = b->_x;
bxe = bx + n;
if (!*bxe)
{
while (--bxe > bx && !*bxe)
--n;
b->_wds = n;
}
}
return q;
}
char *
_dtoa_r (
struct _reent *ptr ,
double d ,
int mode ,
int ndigits ,
int *decpt ,
int *sign ,
char **rve )
{
int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, j, j1, k, k0,
k_check, leftright, m2, m5, s2, s5, spec_case, try_quick;
long L;
int denorm;
unsigned long x;
_Bigint *b, *b1, *delta, *mlo, *mhi, *S;
double d2, ds, eps;
char *s, *s0;
if (ptr->_result)
{
ptr->_result->_k = ptr->_result_k;
ptr->_result->_maxwds = 1 << ptr->_result_k;
_Bfree (ptr, ptr->_result);
ptr->_result = 0;
}
if (((__uint32_t *)& d )[0] & ((__uint32_t)0x80000000L) )
{
*sign = 1;
((__uint32_t *)& d )[0] &= ~((__uint32_t)0x80000000L) ;
}
else
*sign = 0;
if ((((__uint32_t *)& d )[0] & ((__uint32_t)0x7ff00000L) ) == ((__uint32_t)0x7ff00000L) )
{
*decpt = 9999;
s =
! ((__uint32_t *)& d )[1] && !(((__uint32_t *)& d )[0] & 0xfffff) ? "Infinity" :
"NaN";
if (rve)
*rve =
s[3] ? s + 8 :
s + 3;
return s;
}
if (!d)
{
*decpt = 1;
s = "0";
if (rve)
*rve = s + 1;
return s;
}
b = _d2b (ptr, d, &be, &bbits);
if (i = (int) (((__uint32_t *)& d )[0] >> 20 & (((__uint32_t)0x7ff00000L) >> 20 )))
{
d2 = d;
((__uint32_t *)& d2 )[0] &= ((__uint32_t)0xfffffL) ;
((__uint32_t *)& d2 )[0] |= ((__uint32_t)0x3ff00000L) ;
i -= 1023 ;
denorm = 0;
}
else
{
i = bbits + be + (1023 + (53 - 1) - 1);
x = i > 32 ? ((__uint32_t *)& d )[0] << 64 - i | ((__uint32_t *)& d )[1] >> i - 32
: ((__uint32_t *)& d )[1] << 32 - i;
d2 = x;
((__uint32_t *)& d2 )[0] -= 31 * ((__uint32_t)0x100000L) ;
i -= (1023 + (53 - 1) - 1) + 1;
denorm = 1;
}
ds = (d2 - 1.5) * 0.289529654602168 + 0.1760912590558 + i * 0.301029995663981;
k = (int) ds;
if (ds < 0. && ds != k)
k--;
k_check = 1;
if (k >= 0 && k <= 22 )
{
if (d < __mprec_tens [k])
k--;
k_check = 0;
}
j = bbits - i - 1;
if (j >= 0)
{
b2 = 0;
s2 = j;
}
else
{
b2 = -j;
s2 = 0;
}
if (k >= 0)
{
b5 = 0;
s5 = k;
s2 += k;
}
else
{
b2 -= k;
b5 = -k;
s5 = 0;
}
if (mode < 0 || mode > 9)
mode = 0;
try_quick = 1;
if (mode > 5)
{
mode -= 4;
try_quick = 0;
}
leftright = 1;
switch (mode)
{
case 0:
case 1:
ilim = ilim1 = -1;
i = 18;
ndigits = 0;
break;
case 2:
leftright = 0;
case 4:
if (ndigits <= 0)
ndigits = 1;
ilim = ilim1 = i = ndigits;
break;
case 3:
leftright = 0;
case 5:
i = ndigits + k + 1;
ilim = i;
ilim1 = i - 1;
if (i <= 0)
i = 1;
}
j = sizeof (unsigned long);
for (ptr->_result_k = 0; sizeof (_Bigint) - sizeof (unsigned long) + j <= i;
j <<= 1)
ptr->_result_k++;
ptr->_result = _Balloc (ptr, ptr->_result_k);
s = s0 = (char *) ptr->_result;
if (ilim >= 0 && ilim <= 14 && try_quick)
{
i = 0;
d2 = d;
k0 = k;
ilim0 = ilim;
ieps = 2;
if (k > 0)
{
ds = __mprec_tens [k & 0xf];
j = k >> 4;
if (j & 0x10 )
{
j &= 0x10 - 1;
d /= __mprec_bigtens [5 - 1];
ieps++;
}
for (; j; j >>= 1, i++)
if (j & 1)
{
ieps++;
ds *= __mprec_bigtens [i];
}
d /= ds;
}
else if (j1 = -k)
{
d *= __mprec_tens [j1 & 0xf];
for (j = j1 >> 4; j; j >>= 1, i++)
if (j & 1)
{
ieps++;
d *= __mprec_bigtens [i];
}
}
if (k_check && d < 1. && ilim > 0)
{
if (ilim1 <= 0)
goto fast_failed;
ilim = ilim1;
k--;
d *= 10.;
ieps++;
}
eps = ieps * d + 7.;
((__uint32_t *)& eps )[0] -= (53 - 1) * ((__uint32_t)0x100000L) ;
if (ilim == 0)
{
S = mhi = 0;
d -= 5.;
if (d > eps)
goto one_digit;
if (d < -eps)
goto no_digits;
goto fast_failed;
}
if (leftright)
{
eps = 0.5 / __mprec_tens [ilim - 1] - eps;
for (i = 0;;)
{
L = d;
d -= L;
*s++ = '0' + (int) L;
if (d < eps)
goto ret1;
if (1. - d < eps)
goto bump_up;
if (++i >= ilim)
break;
eps *= 10.;
d *= 10.;
}
}
else
{
eps *= __mprec_tens [ilim - 1];
for (i = 1;; i++, d *= 10.)
{
L = d;
d -= L;
*s++ = '0' + (int) L;
if (i == ilim)
{
if (d > 0.5 + eps)
goto bump_up;
else if (d < 0.5 - eps)
{
while (*--s == '0');
s++;
goto ret1;
}
break;
}
}
}
fast_failed:
s = s0;
d = d2;
k = k0;
ilim = ilim0;
}
if (be >= 0 && k <= 14 )
{
ds = __mprec_tens [k];
if (ndigits < 0 && ilim <= 0)
{
S = mhi = 0;
if (ilim < 0 || d <= 5 * ds)
goto no_digits;
goto one_digit;
}
for (i = 1;; i++)
{
L = d / ds;
d -= L * ds;
*s++ = '0' + (int) L;
if (i == ilim)
{
d += d;
if (d > ds || d == ds && L & 1)
{
bump_up:
while (*--s == '9')
if (s == s0)
{
k++;
*s = '0';
break;
}
++*s++;
}
break;
}
if (!(d *= 10.))
break;
}
goto ret1;
}
m2 = b2;
m5 = b5;
mhi = mlo = 0;
if (leftright)
{
if (mode < 2)
{
i =
denorm ? be + (1023 + (53 - 1) - 1 + 1) :
1 + 53 - bbits;
}
else
{
j = ilim - 1;
if (m5 >= j)
m5 -= j;
else
{
s5 += j -= m5;
b5 += j;
m5 = 0;
}
if ((i = ilim) < 0)
{
m2 -= i;
i = 0;
}
}
b2 += i;
s2 += i;
mhi = _i2b (ptr, 1);
}
if (m2 > 0 && s2 > 0)
{
i = m2 < s2 ? m2 : s2;
b2 -= i;
m2 -= i;
s2 -= i;
}
if (b5 > 0)
{
if (leftright)
{
if (m5 > 0)
{
mhi = _pow5mult (ptr, mhi, m5);
b1 = _mult (ptr, mhi, b);
_Bfree (ptr, b);
b = b1;
}
if (j = b5 - m5)
b = _pow5mult (ptr, b, j);
}
else
b = _pow5mult (ptr, b, b5);
}
S = _i2b (ptr, 1);
if (s5 > 0)
S = _pow5mult (ptr, S, s5);
if (mode < 2)
{
if (! ((__uint32_t *)& d )[1] && !(((__uint32_t *)& d )[0] & ((__uint32_t)0xfffffL) )
&& ((__uint32_t *)& d )[0] & ((__uint32_t)0x7ff00000L)
)
{
b2 += 1 ;
s2 += 1 ;
spec_case = 1;
}
else
spec_case = 0;
}
if (i = ((s5 ? 32 - _hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0x1f)
i = 32 - i;
if (i > 4)
{
i -= 4;
b2 += i;
m2 += i;
s2 += i;
}
else if (i < 4)
{
i += 28;
b2 += i;
m2 += i;
s2 += i;
}
if (b2 > 0)
b = _lshift (ptr, b, b2);
if (s2 > 0)
S = _lshift (ptr, S, s2);
if (k_check)
{
if (__mcmp (b, S) < 0)
{
k--;
b = _multadd (ptr, b, 10, 0);
if (leftright)
mhi = _multadd (ptr, mhi, 10, 0);
ilim = ilim1;
}
}
if (ilim <= 0 && mode > 2)
{
if (ilim < 0 || __mcmp (b, S = _multadd (ptr, S, 5, 0)) <= 0)
{
no_digits:
k = -1 - ndigits;
goto ret;
}
one_digit:
*s++ = '1';
k++;
goto ret;
}
if (leftright)
{
if (m2 > 0)
mhi = _lshift (ptr, mhi, m2);
mlo = mhi;
if (spec_case)
{
mhi = _Balloc (ptr, mhi->_k);
memcpy((char *)& mhi ->_sign, (char *)& mlo ->_sign, mlo ->_wds*sizeof(long) + 2*sizeof(int)) ;
mhi = _lshift (ptr, mhi, 1 );
}
for (i = 1;; i++)
{
dig = quorem (b, S) + '0';
j = __mcmp (b, mlo);
delta = __mdiff (ptr, S, mhi);
j1 = delta->_sign ? 1 : __mcmp (b, delta);
_Bfree (ptr, delta);
if (j1 == 0 && !mode && !(((__uint32_t *)& d )[1] & 1))
{
if (dig == '9')
goto round_9_up;
if (j > 0)
dig++;
*s++ = dig;
goto ret;
}
if (j < 0 || j == 0 && !mode
&& !(((__uint32_t *)& d )[1] & 1)
)
{
if (j1 > 0)
{
b = _lshift (ptr, b, 1);
j1 = __mcmp (b, S);
if ((j1 > 0 || j1 == 0 && dig & 1)
&& dig++ == '9')
goto round_9_up;
}
*s++ = dig;
goto ret;
}
if (j1 > 0)
{
if (dig == '9')
{
round_9_up:
*s++ = '9';
goto roundoff;
}
*s++ = dig + 1;
goto ret;
}
*s++ = dig;
if (i == ilim)
break;
b = _multadd (ptr, b, 10, 0);
if (mlo == mhi)
mlo = mhi = _multadd (ptr, mhi, 10, 0);
else
{
mlo = _multadd (ptr, mlo, 10, 0);
mhi = _multadd (ptr, mhi, 10, 0);
}
}
}
else
for (i = 1;; i++)
{
*s++ = dig = quorem (b, S) + '0';
if (i >= ilim)
break;
b = _multadd (ptr, b, 10, 0);
}
b = _lshift (ptr, b, 1);
j = __mcmp (b, S);
if (j > 0 || j == 0 && dig & 1)
{
roundoff:
while (*--s == '9')
if (s == s0)
{
k++;
*s++ = '1';
goto ret;
}
++*s++;
}
else
{
while (*--s == '0');
s++;
}
ret:
_Bfree (ptr, S);
if (mhi)
{
if (mlo && mlo != mhi)
_Bfree (ptr, mlo);
_Bfree (ptr, mhi);
}
ret1:
_Bfree (ptr, b);
*s = 0;
*decpt = k + 1;
if (rve)
*rve = s;
return s0;
}