[Bug libfortran/48602] Invalid F conversion of G descriptor for values close to powers of 10

thenlich at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Mon Apr 18 08:43:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48602

--- Comment #25 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-04-18 08:39:17 UTC ---
After some testing, I found the problem to be optimization-related. It seems
the following term is calculated as a long double and not rounded before the
"if (m < temp)" comparison, resulting in an unexpected and in this case invalid
result.

temp = calculate_exp(mid - 1) * (1 - r * rexp_d);

Compare:
$ gcc -O2 write_float.c && ./a.out
d=2
$ gcc -O2 -fexcess-precision=standard write_float.c && ./a.out
d=1



More information about the Gcc-bugs mailing list