This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

log10(6.2442) returning nan0x8000 — some kind of g ood old fp stack alignment problem?


Hello,

After being pointed to a thread about unexpected NaNs
(http://gcc.gnu.org/ml/gcc-bugs/1999-10/msg00410.html), I decided to
try here to see if the "ghost" I have in my code rings a bell with
anyone...

In short, I have a trigger series of events that I can set off in my
code (an X11 data manipulation app) that will cause the log10()
function to return a NaN for a perfectly valid input. This happens
once per trigger event: preceding and subsequent calls to log10() will
return the expected result for the same (exactly the same!) input
value. The NaN is returned also when I call log10() (or log()) from
gdb, after the trigger event.
Some additional details: this happens on Mac OS X 10.6.4 running on a
mid 2010 MPB with a 2.4Ghz Core2, compiling with gcc-4.0 or
llvm-gcc-4.2.1 (but apparently not with the regular gcc-4.2.1), and
also on a Pentium-M laptop running WinXP and Cygwin. The trigger event
involves a function with variable arguments.

More details and the results of some ongoing investigations on Ars
Technica: http://arstechnica.com/civis/viewtopic.php?p=20913595#p20913595

I've found the way to avoid this from happening (and to deal with it
when it happens at the spot where it happens at the moment), but I'd
prefer to understand the issue. For now, I have the impression I just
chased a ghost to a different hiding place...

thanks in advance,
René Bertin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]