kern/102424: [libc] printf(3) prints ill result.

David Schultz das at FreeBSD.ORG
Sun Dec 16 23:55:44 PST 2007


Thanks for investigating this. It's interesting that the problem
only happens with -fgcse, and then only on amd64 machines in
32-bit mode. Does this happen in a more recent version of FreeBSD?

I don't have an amd64 machine available for testing, and the
vendor's dtoa code is a little hard to read, especially if we're
looking for a compiler bug here. Some ideas:

- See whether contrib/gdtoa/dmisc.c or contrib/gdtoa/dtoa.c is the
  problem. (That is, compile only one of those with -O2 and see
  what happens.)

- Compile libc with -g in your CFLAGS, then run the program with a
  breakpoint on the 'quorem' function. See what value it returns.
  It should never return more than 9.


More information about the freebsd-bugs mailing list