public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/14394] New: [gfortran]  Intrinsic TAN function returns incorrect value
@ 2004-03-03  2:54 bdavis9659 at comcast dot net
  2004-03-03  3:56 ` [Bug fortran/14394] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-03-03  2:54 UTC (permalink / raw)
  To: gcc-bugs

This test distilled from the NIST F77 compiler validation suite, test FM374:

$ cat z.f
        REAL AVS,BVS
        BVS = 1.5747025767
        AVS = TAN(BVS)
        PRINT*,AVS
        END
$ /usr/local/bin/gfortran -static -g z.f
$ ./a.out
  -255.9724

The expected value is -256 +- 0.02  (according to the test)

g77 meets this requirement:

$ g77 z.f
$ ./a.out
 -255.995834

Looking at the output of -fdump-tree-all

$ cat z.f.t03.original
MAIN__ ()
{
  real4 bvs;
  real4 avs;
 
  bvs = 1.5747029781341552734375e+0;
  avs = __builtin_tanf (bvs);
  _gfortran_filename = "z.f";
  _gfortran_line = 4;
  _gfortran_ioparm.unit = 6;
  _gfortran_ioparm.list_format = 1;
  _gfortran_st_write ();
  _gfortran_transfer_real (&avs, 4);
  _gfortran_st_write_done ();;
}

The difference in the two constants explains the difference, so it appears to be
a problem in the fortran front end instead of tan().

-- 
           Summary: [gfortran]  Intrinsic TAN function returns incorrect
                    value
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bdavis9659 at comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-04-11 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03  2:54 [Bug fortran/14394] New: [gfortran] Intrinsic TAN function returns incorrect value bdavis9659 at comcast dot net
2004-03-03  3:56 ` [Bug fortran/14394] " pinskia at gcc dot gnu dot org
2004-03-10  4:46 ` pinskia at gcc dot gnu dot org
2004-04-11 16:06 ` cvs-commit at gcc dot gnu dot org
2004-04-11 17:00 ` pinskia at gcc dot gnu dot 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).