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

* [Bug fortran/14394] [gfortran]  Intrinsic TAN function returns incorrect value
  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 ` pinskia at gcc dot gnu dot org
  2004-03-10  4:46 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-03  3:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-03 03:56 -------
Actually this might not be a front-end problem but then again it might be parsing the number wrong.
Well it works in the C front-end so it looks like the number is being parsed wrong or just getting a 
rounding error when parsing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-03 03:56:01
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug fortran/14394] [gfortran]  Intrinsic TAN function returns incorrect value
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-10  4:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-10 04:46 -------
Patch is here: <http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00828.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug fortran/14394] [gfortran]  Intrinsic TAN function returns incorrect value
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-11 16:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-11 12:49 -------
Subject: Bug 14394

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	pbrook@gcc.gnu.org	2004-04-11 12:49:14

Modified files:
	gcc/fortran    : ChangeLog trans-const.c 

Log message:
	PR 14394
	* trans-const.c (gfc_conv_mpf_to_tree): Loosen the maximum digits of
	the real value when converting mpf to string.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.136&r2=1.1.2.137
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-const.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.6&r2=1.1.2.7



-- 


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


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

* [Bug fortran/14394] [gfortran]  Intrinsic TAN function returns incorrect value
  2004-03-03  2:54 [Bug fortran/14394] New: [gfortran] Intrinsic TAN function returns incorrect value bdavis9659 at comcast dot net
                   ` (2 preceding siblings ...)
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-11 17:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-11 16:06 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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).