public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/5233: gcc-3.0.3 sparc optimize error
@ 2001-12-31 20:36 TANIGUCHI Yasuaki
  0 siblings, 0 replies; only message in thread
From: TANIGUCHI Yasuaki @ 2001-12-31 20:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5233
>Category:       c
>Synopsis:       [sparc solaris] Internal compiler error with -O2, with -O Okey.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 31 20:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     TANIGUCHI Yasuaki
>Release:        3.0.3
>Organization:
personal
>Environment:
System: SunOS wind 5.8 Generic_108528-12 sun4u sparc
>Description:
        Optimize error when I compile mozilla-0.9.7.
        source: mozilla-0 .9.7/js/src/fdlibm/e_pow.c
>How-To-Repeat:
Compiler option and error message:
[yasuaki@wind test]$ gcc --save-temps -c  -fPIC -O2 e_pow.c
e_pow.c: In function `__ieee754_pow':
e_pow.c:376: Insn does not satisfy its constraints:
(insn 2060 1375 1378 (set (reg:SI 8 %o0)
        (reg:SI 39 %f7 [605])) 51 {*movsi_insn} (nil)
    (nil))
e_pow.c:376: Internal compiler error in reload_cse_simplify_operands,
at reload1.c:8364
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Source "e_pow.i":
# 92 "e_pow.c"
# 1 "fdlibm.h" 1
typedef union {
    struct { int hi, lo; } ints;
    double d;
} fd_twoints;
# 16 "fdlibm.h"
extern int signgam;



enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
# 32 "fdlibm.h"
extern enum fdversion _fdlib_version;






struct exception {
        int type;
        char *name;
        double arg1;
        double arg2;
        double retval;
};
# 93 "e_pow.c" 2


static const double



bp[] = {1.0, 1.5,},
dp_h[] = { 0.0, 5.84962487220764160156e-01,},
dp_l[] = { 0.0, 1.35003920212974897128e-08,},
zero = 0.0,
one = 1.0,
two = 2.0,
two53 = 9007199254740992.0,
really_big = 1.0e300,
tiny = 1.0e-300,

L1 = 5.99999999999994648725e-01,
L2 = 4.28571428578550184252e-01,
L3 = 3.33333329818377432918e-01,
L4 = 2.72728123808534006489e-01,
L5 = 2.30660745775561754067e-01,
L6 = 2.06975017800338417784e-01,
P1 = 1.66666666666666019037e-01,
P2 = -2.77777777770155933842e-03,
P3 = 6.61375632143793436117e-05,
P4 = -1.65339022054652515390e-06,
P5 = 4.13813679705723846039e-08,
lg2 = 6.93147180559945286227e-01,
lg2_h = 6.93147182464599609375e-01,
lg2_l = -1.90465429995776804525e-09,
ovt = 8.0085662595372944372e-0017,
cp = 9.61796693925975554329e-01,
cp_h = 9.61796700954437255859e-01,
cp_l = -7.02846165095275826516e-09,
ivln2 = 1.44269504088896338700e+00,
ivln2_h = 1.44269502162933349609e+00,
ivln2_l = 1.92596299112661746887e-08;


        double __ieee754_pow(double x, double y)




{
        fd_twoints ux, uy, uz;
        double y1,t1,p_h,t,z,ax;
        double z_h,z_l,p_l;
        double t2,r,s,u,v,w;
        int i,j,k,yisint,n;
        int hx,hy,ix,iy;
        unsigned lx,ly;

        ux.d = x; uy.d = y;
        hx = ux.ints.hi; lx = ux.ints.lo;
        hy = uy.ints.hi; ly = uy.ints.lo;
        ix = hx&0x7fffffff; iy = hy&0x7fffffff;


        if((iy|ly)==0) return one;


        if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
           iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0)))
                return x+y;






        yisint = 0;
        if(hx<0) {
            if(iy>=0x43400000) yisint = 2;
            else if(iy>=0x3ff00000) {
                k = (iy>>20)-0x3ff;
                if(k>20) {
                    j = ly>>(52-k);
                    if((j<<(52-k))==(int)ly) yisint = 2-(j&1);
                } else if(ly==0) {
                    j = iy>>(20-k);
                    if((j<<(20-k))==iy) yisint = 2-(j&1);
                }
            }
        }


        if(ly==0) {
            if (iy==0x7ff00000) {
                if(((ix-0x3ff00000)|lx)==0)




                    return y - y;

                else if (ix >= 0x3ff00000)
                    return (hy>=0)? y: zero;
                else
                    return (hy<0)?-y: zero;
            }
            if(iy==0x3ff00000) {
                if(hy<0) return one/x; else return x;
            }
            if(hy==0x40000000) return x*x;
            if(hy==0x3fe00000) {
                if(hx>=0)
                return fd_sqrt(x);
            }
        }

        ax = fd_fabs(x);

        if(lx==0) {
            if(ix==0x7ff00000||ix==0||ix==0x3ff00000){
                z = ax;
                if(hy<0) z = one/z;
                if(hx<0) {
                    if(((ix-0x3ff00000)|yisint)==0) {
                        z = (z-z)/(z-z);
                    } else if(yisint==1) {





                        z = -z;

                        }
                }
                return z;
            }
        }


        if((((hx>>31)+1)|yisint)==0) return (x-x)/(x-x);


        if(iy>0x41e00000) {
            if(iy>0x43f00000){
                if(ix<=0x3fefffff) return (hy<0)? really_big*really_big:tiny*tiny;
                if(ix>=0x3ff00000) return (hy>0)? really_big*really_big:tiny*tiny;
            }

            if(ix<0x3fefffff) return (hy<0)? really_big*really_big:tiny*tiny;
            if(ix>0x3ff00000) return (hy>0)? really_big*really_big:tiny*tiny;


            t = x-1;
            w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25));
            u = ivln2_h*t;
            v = t*ivln2_l-w*ivln2;
            t1 = u+v;
            uz.d = t1;
            uz.ints.lo = 0;
            t1 = uz.d;
            t2 = v-(t1-u);
        } else {
            double s_h,t_h;
            double s2,s_l,t_l;
            n = 0;

            if(ix<0x00100000)
                {ax *= two53; n -= 53; uz.d = ax; ix = uz.ints.hi; }
            n += ((ix)>>20)-0x3ff;
            j = ix&0x000fffff;

            ix = j|0x3ff00000;
            if(j<=0x3988E) k=0;
            else if(j<0xBB67A) k=1;
            else {k=0;n+=1;ix -= 0x00100000;}
            uz.d = ax;
            uz.ints.hi = ix;
            ax = uz.d;


            u = ax-bp[k];
            v = one/(ax+bp[k]);
            s = u*v;
            s_h = s;
            uz.d = s_h;
            uz.ints.lo = 0;
            s_h = uz.d;

            t_h = zero;
            uz.d = t_h;
            uz.ints.hi=((ix>>1)|0x20000000)+0x00080000+(k<<18);
            t_h = uz.d;
            t_l = ax - (t_h-bp[k]);
            s_l = v*((u-s_h*t_h)-s_h*t_l);

            s2 = s*s;
            r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
            r += s_l*(s_h+s);
            s2 = s_h*s_h;
            t_h = 3.0+s2+r;
            uz.d = t_h;
            uz.ints.lo = 0;
            t_h = uz.d;
            t_l = r-((t_h-3.0)-s2);

            u = s_h*t_h;
            v = s_l*t_h+t_l*s;

            p_h = u+v;
            uz.d = p_h;
            uz.ints.lo = 0;
            p_h = uz.d;
            p_l = v-(p_h-u);
            z_h = cp_h*p_h;
            z_l = cp_l*p_h+p_l*cp+dp_l[k];

            t = (double)n;
            t1 = (((z_h+z_l)+dp_h[k])+t);
            uz.d = t1;
            uz.ints.lo = 0;
            t1 = uz.d;
            t2 = z_l-(((t1-t)-dp_h[k])-z_h);
        }

        s = one;
        if((((hx>>31)+1)|(yisint-1))==0) s = -one;


        y1 = y;
        uy.d = y1;
        uy.ints.lo = 0;
        y1 = uy.d;
        p_l = (y-y1)*t1+y*t2;
        p_h = y1*t1;
        z = p_l+p_h;
        uz.d = z;
        j = uz.ints.hi;
        i = uz.ints.lo;

        if (j>=0x40900000) {
            if(((j-0x40900000)|i)!=0)
                return s*really_big*really_big;
            else {
                if(p_l+ovt>z-p_h) return s*really_big*really_big;
            }
        } else if((j&0x7fffffff)>=0x4090cc00 ) {
            if(((j-0xc090cc00)|i)!=0)
                return s*tiny*tiny;
            else {
                if(p_l<=z-p_h) return s*tiny*tiny;
            }
        }



        i = j&0x7fffffff;
        k = (i>>20)-0x3ff;
        n = 0;
        if(i>0x3fe00000) {
            n = j+(0x00100000>>(k+1));
            k = ((n&0x7fffffff)>>20)-0x3ff;
            t = zero;
            uz.d = t;
            uz.ints.hi = (n&~(0x000fffff>>k));
            t = uz.d;
            n = ((n&0x000fffff)|0x00100000)>>(20-k);
            if(j<0) n = -n;
            p_h -= t;
        }
        t = p_l+p_h;
        uz.d = t;
        uz.ints.lo = 0;
        t = uz.d;
        u = t*lg2_h;
        v = (p_l-(t-p_h))*lg2+t*lg2_l;
        z = u+v;
        w = v-(z-u);
        t = z*z;
        t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
        r = (z*t1)/(t1-two)-(w+z*w);
        z = one-(r-z);
        uz.d = z;
        j = uz.ints.hi;
        j += (n<<20);
        if((j>>20)<=0) z = fd_scalbn(z,n);
        else { uz.d = z; uz.ints.hi += (n<<20); z = uz.d; }
        return s*z;
}

Assembler code "e_pow.s":
	.file	"e_pow.i"
	.section	".rodata"
	.align 8
	.type	bp,#object
	.size	bp,16
bp:
	.uaword	0x3ff00000 ! ~1.00000000000000000000e0
	.uaword	0x0
	.uaword	0x3ff80000 ! ~1.50000000000000000000e0
	.uaword	0x0
	.align 8
	.type	dp_h,#object
	.size	dp_h,16
dp_h:
	.uaword	0x0 ! ~0.00000000000000000000e0
	.uaword	0x0
	.uaword	0x3fe2b803 ! ~5.84962487220764160156e-1
	.uaword	0x40000000
	.align 8
	.type	dp_l,#object
	.size	dp_l,16
dp_l:
	.uaword	0x0 ! ~0.00000000000000000000e0
	.uaword	0x0
	.uaword	0x3e4cfdeb ! ~1.35003920212974897128e-8
	.uaword	0x43cfd006
	.align 8
	.type	zero,#object
	.size	zero,8
zero:
	.uaword	0x0 ! ~0.00000000000000000000e0
	.uaword	0x0
	.align 8
	.type	one,#object
	.size	one,8
one:
	.uaword	0x3ff00000 ! ~1.00000000000000000000e0
	.uaword	0x0
	.align 8
	.type	two,#object
	.size	two,8
two:
	.uaword	0x40000000 ! ~2.00000000000000000000e0
	.uaword	0x0
	.align 8
	.type	two53,#object
	.size	two53,8
two53:
	.uaword	0x43400000 ! ~9.00719925474099200000e15
	.uaword	0x0
	.align 8
	.type	really_big,#object
	.size	really_big,8
really_big:
	.uaword	0x7e37e43c ! ~1.00000000000000005250e300
	.uaword	0x8800759c
	.align 8
	.type	tiny,#object
	.size	tiny,8
tiny:
	.uaword	0x1a56e1f ! ~1.00000000000000002506e-300
	.uaword	0xc2f8f359
	.align 8
	.type	L1,#object
	.size	L1,8
L1:
	.uaword	0x3fe33333 ! ~5.99999999999994648725e-1
	.uaword	0x33333303
	.align 8
	.type	L2,#object
	.size	L2,8
L2:
	.uaword	0x3fdb6db6 ! ~4.28571428578550184252e-1
	.uaword	0xdb6fabff
	.align 8
	.type	L3,#object
	.size	L3,8
L3:
	.uaword	0x3fd55555 ! ~3.33333329818377432918e-1
	.uaword	0x518f264d
	.align 8
	.type	L4,#object
	.size	L4,8
L4:
	.uaword	0x3fd17460 ! ~2.72728123808534006489e-1
	.uaword	0xa91d4101
	.align 8
	.type	L5,#object
	.size	L5,8
L5:
	.uaword	0x3fcd864a ! ~2.30660745775561754067e-1
	.uaword	0x93c9db65
	.align 8
	.type	L6,#object
	.size	L6,8
L6:
	.uaword	0x3fca7e28 ! ~2.06975017800338417784e-1
	.uaword	0x4a454eef
	.align 8
	.type	P1,#object
	.size	P1,8
P1:
	.uaword	0x3fc55555 ! ~1.66666666666666019037e-1
	.uaword	0x5555553e
	.align 8
	.type	P2,#object
	.size	P2,8
P2:
	.uaword	0xbf66c16c ! ~-2.77777777770155933842e-3
	.uaword	0x16bebd93
	.align 8
	.type	P3,#object
	.size	P3,8
P3:
	.uaword	0x3f11566a ! ~6.61375632143793436117e-5
	.uaword	0xaf25de2c
	.align 8
	.type	P4,#object
	.size	P4,8
P4:
	.uaword	0xbebbbd41 ! ~-1.65339022054652515390e-6
	.uaword	0xc5d26bf1
	.align 8
	.type	P5,#object
	.size	P5,8
P5:
	.uaword	0x3e663769 ! ~4.13813679705723846039e-8
	.uaword	0x72bea4d0
	.align 8
	.type	lg2,#object
	.size	lg2,8
lg2:
	.uaword	0x3fe62e42 ! ~6.93147180559945286227e-1
	.uaword	0xfefa39ef
	.align 8
	.type	lg2_h,#object
	.size	lg2_h,8
lg2_h:
	.uaword	0x3fe62e43 ! ~6.93147182464599609375e-1
	.uaword	0x0
	.align 8
	.type	lg2_l,#object
	.size	lg2_l,8
lg2_l:
	.uaword	0xbe205c61 ! ~-1.90465429995776804525e-9
	.uaword	0xca86c39
	.align 8
	.type	ovt,#object
	.size	ovt,8
ovt:
	.uaword	0x3c971547 ! ~8.00856625953729410197e-17
	.uaword	0x652b82fe
	.align 8
	.type	cp,#object
	.size	cp,8
cp:
	.uaword	0x3feec709 ! ~9.61796693925975554329e-1
	.uaword	0xdc3a03fd
	.align 8
	.type	cp_h,#object
	.size	cp_h,8
cp_h:
	.uaword	0x3feec709 ! ~9.61796700954437255859e-1
	.uaword	0xe0000000
	.align 8
	.type	cp_l,#object
	.size	cp_l,8
cp_l:
	.uaword	0xbe3e2fe0 ! ~-7.02846165095275826516e-9
	.uaword	0x145b01f5
	.align 8
	.type	ivln2,#object
	.size	ivln2,8
ivln2:
	.uaword	0x3ff71547 ! ~1.44269504088896338700e0
	.uaword	0x652b82fe
	.align 8
	.type	ivln2_h,#object
	.size	ivln2_h,8
ivln2_h:
	.uaword	0x3ff71547 ! ~1.44269502162933349609e0
	.uaword	0x60000000
	.align 8
	.type	ivln2_l,#object
	.size	ivln2_l,8
ivln2_l:
	.uaword	0x3e54ae0b ! ~1.92596299112661746887e-8
	.uaword	0xf85ddf44


>Fix:
        Sorry. no idea
>Release-Note:
>Audit-Trail:
>Unformatted:
 >SUNW,Sun-Blade-100
 Architecture: sun4
 
         <machine, os, target, libraries (multiple lines)>
 host: sparc-sun-solaris2.8
 build: sparc-sun-solaris2.8
 target: sparc-sun-solaris2.8
 configured with: ../gcc-3.0.3/configure --enable-shared
 --enable-threads=solaris
  --with-cpu=ultrasparc


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-01  4:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-31 20:36 c/5233: gcc-3.0.3 sparc optimize error TANIGUCHI Yasuaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).