[M3devel] A warning on dtoa.h
Rodney M. Bates
rodney.bates at wichita.edu
Wed Aug 22 18:28:46 CEST 2007
I have located a case where dtoa.h (which is in libm3core) gives a
wrong result when compiled by gcc 3.4.3 -O2 but works correctly
with -O0. When compiled by gcc 4.1.1, this case works correctly
with either optimization level.
Whether this is a bug in gcc 3.4.3 -O2, or whether dtoa.h has some
"undefined" code remains to be seen.
In either case, beware. It caused pm3 to miscompile the REAL constant
2.0, used in Table.mg, which made an instantiation of Table get a false
runtime range error. It took days to track down. I had another
instance of a bad real constant being compiled from a long time ago,
that I never diagnosed.
cm3 uses a virtually identical dtoa.h, and nothing in the call chain
leading up to the instance where I found the problem is materially
changed from pm3 to cm3, so probably cm3 is affected in the same
way.
--
-------------------------------------------------------------
Rodney M. Bates, retired assistant professor
Dept. of Computer Science, Wichita State University
Wichita, KS 67260-0083
316-978-3922
rodney.bates at wichita.edu
More information about the M3devel
mailing list