[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

NWFPE, -O and shark



Hello,

So I finally found some time to compile and debug things on the shark.
I now found the point where the mp3blaster died with an illegal instruction.
Take this little program:

#include <math.h>
typedef float REAL;
static REAL ca[8],cs[8];

void main(void){
    static REAL Ci[8]=
      {-0.6f,-0.535f,-0.33f,-0.185f,-0.095f,-0.041f,-0.0142f,-0.0037f};
    REAL sq;
    int i;

    for(i=0;i<8;i++)
    {
      sq=sqrt(1.0f+Ci[i]*Ci[i]);
      cs[i]=1.0f/sq;
      ca[i]=Ci[i]*cs[i];
    }
}

compiled with gcc -lm -o ft ft.c it works and prints a number.
compiled with an additional -O it dies.
(the source comes from mpegsound/mpeglayer3.cc
from the mp3blaster sources.) There is another part that
fails in that file, beginning at line 177.

I compiled mpeglayer3.cc without the -O flag and from then on
the blaster worked (though io is far to slow on the shark...)

Given a recent message on ssh, what is this, a bug in GCCs
optimization? A bug in FPE? My fault?

X fails for the same reason (Signal 8, SIGFPE).

At the moment I use gcc 2.95, g++ 2.95, binutils 2.9.1
I didn't compile X myself though and the original
mp3blaster*.deb also died.

Cheers
   Alexander


-- 
       ,,,
      (o o)
+-oOO--(_)--OOo--/""""""""""""""""""""""""""T"""""""""""""""""""""""""""""""T
| schulz@ira.uka.de                         | ... because you are always as |
| Alexander.Schulz@stud.uni-karlsruhe.de    | dead as you think you are!    |
| www.uni-karlsruhe.de/~Alexander.Schulz    | (D. Adams : mostly harmless)  |
+-------------------------------------------+-------------------------------+


Reply to: