This is the mail archive of the
mailing list for the GCC project.
Re: [fortran,patch] Patch for PR 14394 - Precision of real type.
- From: Feng Wang <wf_cs at yahoo dot com>
- To: fortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Cc: stevenb at suse dot de, Paul Brook <paul at codesourcery dot com>, tjzhang at quantumstates dot com, sgk at troutmask dot apl dot washington dot edu
- Date: Thu, 11 Mar 2004 10:05:03 +0800 (CST)
- Subject: Re: [fortran,patch] Patch for PR 14394 - Precision of real type.
Thanks to Tianjiao and Steve.
To sum up,
-255.998704134517: NAG(gcc BE), gcc, pgf90 -r8 and f77 WorkShop Compilers 4.2
-255.995833263172: pgf90 (without -r8), ifort (Intel's) and orf90 (Sgi's, I
Hard to judge. As Tianjiao said, if we use gcc to check the accuracy, the patch
is acceptable. At least, I think the difference is caused by backend, the patch
fixed gfortran's frontend.
--- Feng Wang <firstname.lastname@example.org> wrote:> Hi, all
> This patch fix PR 14394. Reported by Bud. Test case:
> cat z.f
> REAL AVS,BVS
> BVS = 1.5747025767
> AVS = TAN(BVS)
> There is one problem converting the real type from mpf to gcc tree. With
> -fdump-parse-tree we can see fortran gets the input and parse correctly.
> gfc_conv_mpf_to_tree in trans-const.c use string as the intermediate of the
> conversion. As convert mpf to string, we specify the maximum digits number of
> the real value. In my patch, I loosen the limit.
> I tested real and real*8 type with the patch. The real type got the same
> result with Intel's compiler. But with real*8 type, gfortran gave the result:
> -255.998704134517, compared with Intel's -255.995833263172. The difference of
> them is above 0.002. With calculator I comfirmed the gfortran's result should
> be correct. But can anyone give more comparation with other compilers. What's
> your opinion?
> Feng Wang
Do You Yahoo!?