public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48906] New: Wrong rounding results with -m32
@ 2011-05-06  1:31 jvdelisle at gcc dot gnu.org
  2011-05-06 21:33 ` [Bug libfortran/48906] " jvdelisle at gcc dot gnu.org
                   ` (40 more replies)
  0 siblings, 41 replies; 43+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-05-06  1:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Wrong rounding results with -m32
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: jvdelisle@gcc.gnu.org
        ReportedBy: jvdelisle@gcc.gnu.org


This PR is to carry forward the remaining issue identified in PR48602 comment
#37

Here is a test case showing the problem.

 print "(ru,g15.2)", .099d0 ! > 0.10E+00 expected 0.10
 print "(rc,g15.1)", .095d0 ! > 0.1E+00 expected 0.1
 print "(rc,g15.2)", .0995d0 ! > 0.10E+00 expected 0.10
 print "(ru,g15.3)", .0999d0 ! > 0.100E+00 expected 0.100

end

$ gfc bug.f03 
$ ./a.out 
       0.10    
        0.1    
       0.10    
      0.100    
$ gfc -O1 bug.f03 
$ ./a.out 
       0.10    
        0.1    
       0.10    
      0.100    
$ gfc -m32 -O1 bug.f03 
$ ./a.out 
       0.10E+00
        0.1E+00
       0.10E+00
      0.100E+00
$ gfc -m32 bug.f03 
$ ./a.out 
       0.10E+00
        0.1E+00
       0.10E+00
      0.100E+00

The problem is rooted in excess precision and that we use sensitive floating
point operations to determine the formatting parameters.  I am seeking a
solution that will avoid using floating point to do this.


^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2014-01-11 21:44 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06  1:31 [Bug libfortran/48906] New: Wrong rounding results with -m32 jvdelisle at gcc dot gnu.org
2011-05-06 21:33 ` [Bug libfortran/48906] " jvdelisle at gcc dot gnu.org
2011-05-06 21:52 ` kargl at gcc dot gnu.org
2011-05-10 13:05 ` jvdelisle at gcc dot gnu.org
2011-05-10 17:21 ` thenlich at users dot sourceforge.net
2011-05-19  5:55 ` jvdelisle at gcc dot gnu.org
2011-05-19  8:36 ` thenlich at users dot sourceforge.net
2011-05-19 13:21 ` jvdelisle at gcc dot gnu.org
2011-05-23 19:27 ` jvdelisle at gcc dot gnu.org
2011-05-26 13:02 ` jvdelisle at gcc dot gnu.org
2011-05-27  7:21 ` thenlich at users dot sourceforge.net
2011-05-27  8:56 ` thenlich at users dot sourceforge.net
2011-05-27 13:14 ` thenlich at users dot sourceforge.net
2011-05-27 14:34 ` jvdelisle at gcc dot gnu.org
2011-05-30 18:53 ` jvdelisle at gcc dot gnu.org
2011-05-31  6:28 ` thenlich at users dot sourceforge.net
2011-05-31  6:41 ` thenlich at users dot sourceforge.net
2011-05-31 12:38 ` jvdelisle at gcc dot gnu.org
2011-06-01  5:09 ` jvdelisle at gcc dot gnu.org
2011-06-01  6:26 ` thenlich at users dot sourceforge.net
2011-06-01  8:13 ` thenlich at users dot sourceforge.net
2011-06-01 12:27 ` jvdelisle at gcc dot gnu.org
2011-06-02  3:58 ` jvdelisle at gcc dot gnu.org
2011-06-03 12:56 ` jvdelisle at gcc dot gnu.org
2011-06-06  8:38 ` thenlich at users dot sourceforge.net
2011-06-06 12:09   ` jerry DeLisle
2011-06-06 12:10 ` jvdelisle at charter dot net
2011-06-06 12:27 ` thenlich at users dot sourceforge.net
2011-06-06 12:36 ` jvdelisle at charter dot net
2011-06-06 12:42 ` thenlich at users dot sourceforge.net
2011-06-06 12:48 ` thenlich at users dot sourceforge.net
2011-06-07  6:56 ` thenlich at users dot sourceforge.net
2011-06-07  6:57 ` thenlich at users dot sourceforge.net
2011-06-07 17:06 ` jvdelisle at gcc dot gnu.org
2011-06-10 16:16 ` jvdelisle at gcc dot gnu.org
2011-06-10 16:22 ` jvdelisle at gcc dot gnu.org
2011-06-10 16:56 ` thenlich at users dot sourceforge.net
2011-06-10 17:02 ` thenlich at users dot sourceforge.net
2011-06-10 17:30 ` jvdelisle at gcc dot gnu.org
2011-07-01  9:23 ` thenlich at users dot sourceforge.net
2011-07-02  1:33 ` jvdelisle at gcc dot gnu.org
2013-06-16 16:56 ` dominiq at lps dot ens.fr
2014-01-11 21:44 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).