From: Bao C. H. <ba...@se...> - 2001-08-16 16:59:47
|
(gdb) n 14 printf("\n status=%x\n", (int)status); (gdb) set archi sh4 The target architecture is assumed to be sh4 (gdb) p/x $fpscr $2 = 0x3f737871 (gdb) n status=%x dum=%f ...... CRASHED!!! So it is the wrong FPU mode. How do we fix it? Thanks. Bao > -----Original Message----- > From: lin...@li... > [mailto:lin...@li...]On Behalf Of > kaz Kojima > Sent: Wednesday, August 15, 2001 8:04 PM > To: lin...@li... > Subject: [linuxsh-dev] Re: Floating point problem > > > "Bao C. Ha" <ba...@se...> wrote: > > -static works > > -O2 does not work (crash!) > > > > Following is a gdb session when it crashes. Note the > > "correct" values of dum = -0.95105654 and status = 1! > > > > Breakpoint 1, main () at test.c:13 > > 13 status = fscanf(fptr,"%f", &dum); > > (gdb) n > > 14 printf("\n status=%x\n", (int)status); > > (gdb) print dum > > $3 = -0.95105654 > > (gdb) print status > > $4 = 1 > > Can you please check the result of the following gdb commands at this > point? > > (gdb) set archi sh4 > (gdb) p/x $fpscr > > If you don't get 0x8xxxx as the value of fpscr register, the cause of > the crash will be the wrong mode of FPU. > > kaz > > _______________________________________________ > linuxsh-dev mailing list > lin...@li... > http://lists.sourceforge.net/lists/listinfo/linuxsh-dev > |