[Bug c/41867] Translation time Floating Point precision is too small
--- Comment #4 from tydeman at tybor dot com 2009-10-31 17:42 --- The requirement that translation time precision be at least as great as runtime precision existed in C89, C90, C95, and C99 (so has been around for 20 years). My code is a test of translation time precision versus runtime precision. The first code I saw in bug 323 involved 3 auto variables (so is just runtime). That is a different issue, so I believe that this bug is not a duplicate of 323. I used gnu99 instead of c99 for the std because I also am testing Decimal FP in addition to Binary FP. Where should I find documentation on compiler options to get as close to C99 conformance as possible? Also, C99 + Decimal FP conformance? The output you show is what I expected. -- tydeman at tybor dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|DUPLICATE | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41867
[Bug c/41867] Translation time Floating Point precision is too small
--- Comment #5 from jsm28 at gcc dot gnu dot org 2009-10-31 18:37 --- 323 covers all excess precision issues. Predictable results that do not depend on when a computation is carried out require -fexcess-precision=standard which requires 4.5. It so happens that all C conformance options, including -std=c89, enable -fexcess-precision=standard; although C90 does not define any standard binding to excess precision such as C99 does with FLT_EVAL_METHOD, enabling it for C90 conformance seemed the best compromise. Options are documented in the GCC manual (specifically, invoke.texi in the GCC sources). The closest conformance options are -std={c89,iso9899:199409,c99} -pedantic (or -pedantic-errors if you want errors for constraint violations). There are no known target-independent conformance bugs in -std=c89 -pedantic or -std=iso9899:199409 -pedantic (excess precision issues are target-dependent) in 4.5 (there are various such bugs in 4.4). http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html is the online version of the documentation for conformance options; http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html includes the floating-point options and http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html describes -pedantic. There are no options to enable C99 conformance except for allowing decimal floating point. If you want -fdecimal-fp or similar to enable decimal floating point in a strict conformance mode, that would be a separate issue. *** This bug has been marked as a duplicate of 323 *** -- jsm28 at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41867
[Bug c/41867] Translation time Floating Point precision is too small
--- Comment #1 from joseph at codesourcery dot com 2009-10-29 15:47 --- Subject: Re: New: Translation time Floating Point precision is too small On Thu, 29 Oct 2009, tydeman at tybor dot com wrote: The following code fails on (at least) Intel x86/x87 systems running Linux: Please explain what you mean by fails. With what options did you compile it? How was GCC configured? What did it output? What did you want it to output instead? Why do you think what it output was wrong? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41867
[Bug c/41867] Translation time Floating Point precision is too small
--- Comment #2 from tydeman at tybor dot com 2009-10-29 19:27 --- Compile options: -std=gnu99 -pedantic -H -fno-builtin -frounding-math Since I take the gcc that comes with Fedora Core Linux 9 and 10, I have no idea how GCC was configured. The output shows that all the file scope (translation time) precisions used were small (ULP is same magnitude as FLT_EPSILON), while all the local scope (runtime) precisions used were large (ULP same magnitude as LDBL_EPSILON). All six should be the same magnitude as LDBL_EPSILON for this hardware. None of the messages with 1:, 2:, 3:, 7:, 8:, 11:, or 12: should be printed if things are done as per the C standard. A large precision implies a small magnitude ULP value (closer to zero). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41867
[Bug c/41867] Translation time Floating Point precision is too small
--- Comment #3 from jsm28 at gcc dot gnu dot org 2009-10-29 20:26 --- If you want C99-conforming excess precision, then use 4.5 or later (not 4.4) with -fexcess-precision=standard or strict conformance options such as -std=c99 that imply it (not -std=gnu99). With that I get: ls_ld2=1.0842e-19 ls_d2 =1.0842e-19 ls_f2 =1.0842e-19 LD_EPS=1.0842e-19 D_EPS=2.22045e-16 F_EPS=1.19209e-07 fs_ld2=1.0842e-19 fs_d2 =1.0842e-19 fs_f2 =1.0842e-19 which I think is what you want. *** This bug has been marked as a duplicate of 323 *** -- jsm28 at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41867