This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Sig6 when compiling Newlib 1.8.0
- To: egcs-bugs at cygnus dot com
- Subject: Sig6 when compiling Newlib 1.8.0
- From: Jussi Ylänen <jethro at students dot cc dot tut dot fi>
- Date: Sun, 8 Mar 1998 17:39:52 +0200 (EET)
When compiling Cygnus Newlib 1.8.0 for h8300-hms target on a RedHat 4.2
Linux Intel machine, I get
h8300-hms-gcc -g -O2 -O2 -DSMALL_DTOA -DSMALL_MEMORY -fno-builtin
-I/home/jethro/h8300-hms-build/newlib-build/h8300-hms/newlib/./targ-include
-I/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/./libc/include -c
../../../../../newlib-1.8.0/newlib/libm/math/ef_hypot.c
h8300-hms-gcc: Internal compiler error: program cc1 got fatal signal 6
(Long lines wrapped.) Compiling the file with -O0 works.
Egcs was configured with
configure --prefix /home/jethro/h8300-hms --target h8300-hms --enable-haifa
--with-newlib
and compiled with (gcc -v):
Reading specs from /usr/lib/gcc-lib/i386-linux/2.7.2.1/specs
gcc version 2.7.2.1
h8300-hms-gcc -v gives:
Reading specs from
/home/jethro/h8300-hms/lib/gcc-lib/h8300-hms/egcs-2.90.25/specs
gcc version egcs-2.90.25 980302 (egcs-1.0.2 prerelease)
Included below is the problem file, produced with h8300-hms-gcc -E ... >file.
--
Jussi Ylänen (jethro@cc.tut.fi)
---- ef_hypot.i ----
# 1 "../../../../../newlib-1.8.0/newlib/libm/math/ef_hypot.c"
# 1 "../../../../../newlib-1.8.0/newlib/libm/math/fdlibm.h" 1
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/math.h" 1
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/sys/reent.h" 1
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/_ansi.h" 1
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/sys/config.h" 1
# 25 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/sys/config.h"
# 44 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/sys/config.h"
typedef long int __int32_t;
typedef unsigned long int __uint32_t;
# 15 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/_ansi.h" 2
# 61 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/_ansi.h"
# 13 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/sys/reent.h" 2
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 *) ;
# 9 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/math.h" 2
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/machine/ieeefp.h" 1
# 125 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/machine/ieeefp.h"
# 10 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/math.h" 2
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 ;
# 15 "../../../../../newlib-1.8.0/newlib/libm/math/fdlibm.h" 2
# 1 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/machine/ieeefp.h" 1
# 125 "/home/jethro/h8300-hms-build/newlib-1.8.0/newlib/libc/include/machine/ieeefp.h"
# 16 "../../../../../newlib-1.8.0/newlib/libm/math/fdlibm.h" 2
extern double logb (double) ;
extern double scalb (double, double) ;
extern double significand (double) ;
extern double __ieee754_sqrt (double) ;
extern double __ieee754_acos (double) ;
extern double __ieee754_acosh (double) ;
extern double __ieee754_log (double) ;
extern double __ieee754_atanh (double) ;
extern double __ieee754_asin (double) ;
extern double __ieee754_atan2 (double,double) ;
extern double __ieee754_exp (double) ;
extern double __ieee754_cosh (double) ;
extern double __ieee754_fmod (double,double) ;
extern double __ieee754_pow (double,double) ;
extern double __ieee754_lgamma_r (double,int *) ;
extern double __ieee754_gamma_r (double,int *) ;
extern double __ieee754_log10 (double) ;
extern double __ieee754_sinh (double) ;
extern double __ieee754_hypot (double,double) ;
extern double __ieee754_j0 (double) ;
extern double __ieee754_j1 (double) ;
extern double __ieee754_y0 (double) ;
extern double __ieee754_y1 (double) ;
extern double __ieee754_jn (int,double) ;
extern double __ieee754_yn (int,double) ;
extern double __ieee754_remainder (double,double) ;
extern __int32_t __ieee754_rem_pio2 (double,double*) ;
extern double __ieee754_scalb (double,double) ;
extern double __kernel_standard (double,double,int) ;
extern double __kernel_sin (double,double,int) ;
extern double __kernel_cos (double,double) ;
extern double __kernel_tan (double,double,int) ;
extern int __kernel_rem_pio2 (double*,double*,int,int,int,const __int32_t*) ;
extern float logbf (float) ;
extern float scalbf (float, float) ;
extern float significandf (float) ;
extern float __ieee754_sqrtf (float) ;
extern float __ieee754_acosf (float) ;
extern float __ieee754_acoshf (float) ;
extern float __ieee754_logf (float) ;
extern float __ieee754_atanhf (float) ;
extern float __ieee754_asinf (float) ;
extern float __ieee754_atan2f (float,float) ;
extern float __ieee754_expf (float) ;
extern float __ieee754_coshf (float) ;
extern float __ieee754_fmodf (float,float) ;
extern float __ieee754_powf (float,float) ;
extern float __ieee754_lgammaf_r (float,int *) ;
extern float __ieee754_gammaf_r (float,int *) ;
extern float __ieee754_log10f (float) ;
extern float __ieee754_sinhf (float) ;
extern float __ieee754_hypotf (float,float) ;
extern float __ieee754_j0f (float) ;
extern float __ieee754_j1f (float) ;
extern float __ieee754_y0f (float) ;
extern float __ieee754_y1f (float) ;
extern float __ieee754_jnf (int,float) ;
extern float __ieee754_ynf (int,float) ;
extern float __ieee754_remainderf (float,float) ;
extern __int32_t __ieee754_rem_pio2f (float,float*) ;
extern float __ieee754_scalbf (float,float) ;
extern float __kernel_sinf (float,float,int) ;
extern float __kernel_cosf (float,float) ;
extern float __kernel_tanf (float,float,int) ;
extern int __kernel_rem_pio2f (float*,float*,int,int,int,const __int32_t*) ;
typedef union
{
double value;
struct
{
__uint32_t msw;
__uint32_t lsw;
} parts;
} ieee_double_shape_type;
# 176 "../../../../../newlib-1.8.0/newlib/libm/math/fdlibm.h"
typedef union
{
float value;
__uint32_t word;
} ieee_float_shape_type;
# 16 "../../../../../newlib-1.8.0/newlib/libm/math/ef_hypot.c" 2
float __ieee754_hypotf(float x, float y)
{
float a=x,b=y,t1,t2,y1,y2,w;
__int32_t j,k,ha,hb;
do { ieee_float_shape_type gf_u; gf_u.value = ( x ); ( ha ) = gf_u.word; } while (0) ;
ha &= 0x7fffffffL;
do { ieee_float_shape_type gf_u; gf_u.value = ( y ); ( hb ) = gf_u.word; } while (0) ;
hb &= 0x7fffffffL;
if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
do { ieee_float_shape_type sf_u; sf_u.word = ( ha ); ( a ) = sf_u.value; } while (0) ;
do { ieee_float_shape_type sf_u; sf_u.word = ( hb ); ( b ) = sf_u.value; } while (0) ;
if((ha-hb)>0xf000000L) {return a+b;}
k=0;
if(ha > 0x58800000L) {
if(ha >= 0x7f800000L) {
w = a+b;
if(ha == 0x7f800000L) w = a;
if(hb == 0x7f800000L) w = b;
return w;
}
ha -= 0x5d800000L; hb -= 0x5d800000L; k += 60;
do { ieee_float_shape_type sf_u; sf_u.word = ( ha ); ( a ) = sf_u.value; } while (0) ;
do { ieee_float_shape_type sf_u; sf_u.word = ( hb ); ( b ) = sf_u.value; } while (0) ;
}
if(hb < 0x26800000L) {
if(hb <= 0x007fffffL) {
if(hb==0) return a;
do { ieee_float_shape_type sf_u; sf_u.word = ( 0x3f000000L ); ( t1 ) = sf_u.value; } while (0) ;
b *= t1;
a *= t1;
k -= 126;
} else {
ha += 0x5d800000;
hb += 0x5d800000;
k -= 60;
do { ieee_float_shape_type sf_u; sf_u.word = ( ha ); ( a ) = sf_u.value; } while (0) ;
do { ieee_float_shape_type sf_u; sf_u.word = ( hb ); ( b ) = sf_u.value; } while (0) ;
}
}
w = a-b;
if (w>b) {
do { ieee_float_shape_type sf_u; sf_u.word = ( ha&0xfffff000L ); ( t1 ) = sf_u.value; } while (0) ;
t2 = a-t1;
w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
a = a+a;
do { ieee_float_shape_type sf_u; sf_u.word = ( hb&0xfffff000L ); ( y1 ) = sf_u.value; } while (0) ;
y2 = b - y1;
do { ieee_float_shape_type sf_u; sf_u.word = ( ha+0x00800000L ); ( t1 ) = sf_u.value; } while (0) ;
t2 = a - t1;
w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
do { ieee_float_shape_type sf_u; sf_u.word = ( 0x3f800000L+(k<<23) ); ( t1 ) = sf_u.value; } while (0) ;
return t1*w;
} else return w;
}