Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
9 user(s) are online (9 user(s) are browsing Forum)

Members: 0
Guests: 9

more...


Browsing this Thread:   1 Anonymous Users






Re: Code crashes icaros
#8
Home away from home
Home away from home


See User information
are you able to test a small change?


in compiler/mlib/s_rint.c

line 41

double w,t;


change to ..

volatile double w;
    
double t;


and let me know if that fixes it? it seems that "w" gets optimised away.

Posted on: 2013/7/26 22:06
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#7
Home away from home
Home away from home


See User information
Quote:

Kalamatee wrote:

Excuse my ignorance - but what is mlib optimisation?

If you mean gcc optimising the mlib code - then probably yes (unless you can see why it breaks?)


Yes, I just meant adding -O0 to CFLAGS.

I think it crashes somewhere in this function (compiler/mlib/s_rint.c):

double
rint
(double x)
{
        
int32_t i0,j0,sx;
        
u_int32_t i,i1;
        
double w,t;
        
EXTRACT_WORDS(i0,i1,x);
        
sx = (i0>>31)&1;
        
j0 = ((i0>>20)&0x7ff)-0x3ff;
        if(
j0<20) {
            if(
j0<0) {
                if(((
i0&0x7fffffff)|i1)==0) return x;
                
i1 |= (i0&0x0fffff);
                
i0 &= 0xfffe0000;
                
i0 |= ((i1|-i1)>>12)&0x80000;
                
SET_HIGH_WORD(x,i0);
                
w = TWO52[sx]+x;
                
t =  w-TWO52[sx];
                
GET_HIGH_WORD(i0,t);
                
SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
                return 
t;      
            } else {
                
i = (0x000fffff)>>j0;
                if(((
i0&i)|i1)==0) return x; /* x is integral */
                
i>>=1;
                if(((
i0&i)|i1)!=0) {
                    
/*
                     * Some bit is set after the 0.5 bit.  To avoid the
                     * possibility of errors from double rounding in
                     * w = TWO52[sx]+x, adjust the 0.25 bit to a lower
                     * guard bit.  We do this for all j0<=51.  The
                     * adjustment is trickiest for j0==18 and j0==19
                     * since then it spans the word boundary.
                     */
                    
if(j0==19) i1 = 0x40000000; else
                    if(
j0==18) i1 = 0x80000000; else
                    
i0 = (i0&(~i))|((0x20000)>>j0);
                }
            }
        } else if (
j0>51) {
            if(
j0==0x400) return x+x;   /* inf or NaN */
            
else return x;              /* x is integral */
        
} else {
            
i = ((u_int32_t)(0xffffffff))>>(j0-20);
            if((
i1&i)==0) return x;     /* x is integral */
            
i>>=1;
            if((
i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));
        }
        
INSERT_WORDS(x,i0,i1);
        *(
volatile double *)&w = TWO52[sx]+x;   /* clip any extra precision */
        
return w-TWO52[sx];
}

Posted on: 2013/7/26 20:15
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#6
Just can't stay away
Just can't stay away


See User information
With the included lrint() it doesn't crash anymore, even with -O3 set. I only commented out the math.h coz else it wouldn't compile correctly (round() issue).

Attach file:


Link only for registered users

Posted on: 2013/7/26 18:53
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#5
Home away from home
Home away from home


See User information
Quote:

ncafferkey wrote:
It crashes in lrint(). It can be worked around by turning off optimisation for mlib.

@Kalamatee and other developers:
Should I turn off mlib optimisation for ABIv0?


Excuse my ignorance - but what is mlib optimisation?

If you mean gcc optimising the mlib code - then probably yes (unless you can see why it breaks?)

If its gcc's ability to replace math with more efficient routines, then it might be worth finding out what routines are failing.

It would be nice to know exactly why it fails though so the same problem doesn't crop up again.

Posted on: 2013/7/26 18:43
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#4
Home away from home
Home away from home


See User information
It crashes in lrint(). It can be worked around by turning off optimisation for mlib.

@Kalamatee and other developers:
Should I turn off mlib optimisation for ABIv0?

Posted on: 2013/7/26 17:28
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#3
Just can't stay away
Just can't stay away


See User information
<p>Abi V1 uses a newer version of gcc, which could be the solution. I couldn't compile it myself because of an error with gcc, libgcc.a (file format) doesn't get recognised. The error is also there under nightly abi 0. Also no problem with vbcc aros.</p><p></p><p></p><p>&nbsp;</p><p></p><p>&nbsp;</p><p>&nbsp;</p><p></p><p>&nbsp;</p><p></p><p>&nbsp;</p>

Posted on: 2013/7/26 10:54
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Code crashes icaros
#2
Home away from home
Home away from home


See User information
I tried under ABI v1 and it works correctly there so it must be specific to ABI v0.

You could always try in AROS hosted and see if you can use GDB to identify where/why it crashes.

Posted on: 2013/7/25 23:39
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Code crashes icaros
#1
Just can't stay away
Just can't stay away


See User information
<p>&nbsp;When you compile and run the supplied code, then vmware and vbox (with icaros 1.5.2) are reset completely (starting from the beginning with the grub window). I found the code crashing when running the configure file from libsndfile. Hope someone can check it out and fix this one.</p><p>&nbsp;</p><p></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p></p><p>&nbsp;</p>

Attach file:


Link only for registered users

Posted on: 2013/7/25 21:01
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project