Post by Steve KarglThanks. That got me 1 step closer to compiling FreeBSD's libm.
Unfortunately, I'm now hitting
/home/kargl/../sgk/work/bin/pcc -O2 -pipe -march=opteron -I/usr/home/kargl/trunk/math/libm/msun/x86 -I/usr/home/kargl/trunk/math/libm/msun/ld80 -I/usr/home/kargl/trunk/math/libm/msun/src -I/usr/home/kargl/trunk/math/libm/msun/../libc/include -I/usr/home/kargl/trunk/math/libm/msun/../libc/amd64 -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -c /usr/home/kargl/trunk/math/libm/msun/src/e_scalb.c -o e_scalb.o
/usr/home/kargl/trunk/math/libm/msun/src/e_scalb.c, line 47: compiler error: internal label 420 not defined
error: /home/sgk/work/libexec/ccom terminated with status 1
*** Error code 1
I haven't been able to isolate this one, yet. :(
Stop.
This is an optimization bug (at least of FreeBSD).
~/work/bin/pcc -c d.c (compiles fine)
~/work/bin/pcc -c -O d.c
d.c, line 90: compiler error: internal lable 174 not defined
error: /home/sgk/work/libexec/ccom terminted with status 1
d.c follows sig.
--
Steve
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long __int64_t;
typedef unsigned long __uint64_t;
extern const union __infinity_un {
unsigned char __uc[8];
double __ud;
} __infinity;
extern const union __nan_un {
unsigned char __uc[sizeof(float)];
float __uf;
} __nan;
int __fpclassifyd(double) __attribute__((__const__));
int __fpclassifyf(float) __attribute__((__const__));
int __fpclassifyl(long double) __attribute__((__const__));
int __isfinitef(float) __attribute__((__const__));
int __isfinite(double) __attribute__((__const__));
int __isfinitel(long double) __attribute__((__const__));
int __isinff(float) __attribute__((__const__));
int __isinf(double) __attribute__((__const__));
int __isinfl(long double) __attribute__((__const__));
int __isnormalf(float) __attribute__((__const__));
int __isnormal(double) __attribute__((__const__));
int __isnormall(long double) __attribute__((__const__));
int __signbit(double) __attribute__((__const__));
int __signbitf(float) __attribute__((__const__));
int __signbitl(long double) __attribute__((__const__));
static __inline int
__inline_isnan(const double __x)
{
return (__x != __x);
}
static __inline int
__inline_isnanf(const float __x)
{
return (__x != __x);
}
static __inline int
__inline_isnanl(const long double __x)
{
return (__x != __x);
}
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef union
{
double value;
struct
{
u_int32_t lsw;
u_int32_t msw;
} parts;
struct
{
u_int64_t w;
} xparts;
} ieee_double_shape_type;
double
scalb(double x, double fn)
{
if (__builtin_choose_expr( __builtin_types_compatible_p(__typeof(x), long double), __inline_isnanl(x), __builtin_choose_expr( __builtin_types_compatible_p(__typeof(x), double), __inline_isnan(x), __builtin_choose_expr( __builtin_types_compatible_p(__typeof(x), float), __inline_isnanf(x), (void)0)))||__builtin_choose_expr( __builtin_types_compatible_p(__typeof(fn), long double), __inline_isnanl(fn), __builtin_choose_expr( __builtin_types_compatible_p(__typeof(fn), double), __inline_isnan(fn), __builtin_choose_expr( __builtin_types_compatible_p(__typeof(fn), float), __inline_isnanf(fn), (void)0)))) return x*fn;
if (!finite(fn)) {
if(fn>0.0) return x*fn;
else return x/(-fn);
}
if (rint(fn)!=fn) return (fn-fn)/(fn-fn);
if ( fn > 65000.0) return scalbn(x, 65000);
if (-fn > 65000.0) return scalbn(x,-65000);
return scalbn(x,(int)fn);
}