From: Bao C. H. <ba...@se...> - 2001-08-16 01:04:28
|
-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 (gdb) n status=%x dum=%f |AGNUyyyyyyyy?AU@o@@0@L@h@"@U.Y? A@o@H@ `@ 1 ?AT@o@ ?yyoO@yyyo?yyo?@GCC: (GNU) 2.97 20001120 (experimental)GCC: (GNU) 2.97 2 0001120 (experimental)GCC: (GNU) 2.97 20001120 (experimental)GCC: (GNU) 2.97 200 01120 (experimental)GCC: (GNU) 2.97 20001120 (experimental)GCC: (GNU) 2.97 20001 120 (experimental)?@""-main?@?@test.c/scratch/hotspare/home/baoGNU C 2.97 200011 20 (experimental)?quot?#rem?long long inN__valM?#AAunsigned intint __sched_paramE__sched_priorityFN# M_pthread_fastlock I am actually glad that somebody else besides us also sees the problem. Thanks. Bao > -----Original Message----- > From: lin...@li... > [mailto:lin...@li...]On Behalf Of > kaz Kojima > Sent: Wednesday, August 15, 2001 6:17 AM > To: lin...@li... > Subject: [linuxsh-dev] Re: Floating point problem > > > Stuart Menefy <Stu...@st...> wrote: > > Yep, I see the same problem here. > > > > This is using the RPMS from SourceForge: > > gcc 2.97 (20001120 + patches) > > glibc 2.2.2 > > kernel 2.4.7-pre6 > > basically the same set. > > > > One other oddity, the garbage which is printed at the end > doesn't occur > > when output is redirected to a file, however the floating > point values > > print as 0.00000 rather than the negative number. > > > > Strange > > Indeed. > > One possibility is the problem on changing double/float mode of SH-4 > FPU. Is the result same with the option -O2 or -static? I suspect that > the wrong FPU mode gives such curious behavior. > > kaz > > _______________________________________________ > linuxsh-dev mailing list > lin...@li... > http://lists.sourceforge.net/lists/listinfo/linuxsh-dev > |