public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: fortran/10188: gcc test.c or g77 test.f -malign-double
@ 2003-03-22 13:40 toon
0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2003-03-22 13:40 UTC (permalink / raw)
To: bording, gcc-bugs, gcc-prs, nobody, toon
Synopsis: gcc test.c or g77 test.f -malign-double
Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-By: toon
Responsible-Changed-When: Sat Mar 22 13:40:49 2003
Responsible-Changed-Why:
Fortran Maintainer.
State-Changed-From-To: open->closed
State-Changed-By: toon
State-Changed-When: Sat Mar 22 13:40:49 2003
State-Changed-Why:
Not a bug. A floating point constant in Fortran is a
REAL unless indicated otherwise.
If you need a DOUBLE PRECISION rendition of 5/9, you have
to write 0.555555555555555555D0.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10188
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: fortran/10188: gcc test.c or g77 test.f -malign-double
@ 2003-03-22 1:16 Billinghurst, David (CRTS)
0 siblings, 0 replies; 3+ messages in thread
From: Billinghurst, David (CRTS) @ 2003-03-22 1:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR fortran/10188; it has been noted by GNATS.
From: "Billinghurst, David (CRTS)" <David.Billinghurst@riotinto.com>
To: <bording@bnl.gov>,
<gcc-gnats@gcc.gnu.org>
Cc:
Subject: RE: fortran/10188: gcc test.c or g77 test.f -malign-double
Date: Sat, 22 Mar 2003 12:06:50 +1100
The behaviour you see is expected (and standard conforming)
Try =20
b =3D 0.555555555555555555d0
I will confirm this when I get near a computer with g77 installed.
-----Original Message-----
From: bording@bnl.gov [mailto:bording@bnl.gov]
Sent: Saturday, 22 March 2003 11:54 AM
To: gcc-gnats@gcc.gnu.org
Subject: fortran/10188: gcc test.c or g77 test.f -malign-double
>Number: 10188
>Category: fortran
>Synopsis: gcc test.c or g77 test.f -malign-double
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 22 00:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: bording@bnl.gov
>Release: gcc-3.2.7
>Organization:
>Environment:
Red-Hat 8.0 on Pentium Pro
>Description:
It seems double precision is not used:
----fortran code----
real a
double precision b
a =3D 0.555555555555555555
b =3D 0.555555555555555555
write(6,1) a
write(6,2) b
1 format('real ',f30.28)
2 format('double ',f30.28)
end
gives :=20
real 0.5555555820465087890625000000
double 0.5555555820465087890625000000
------C code -----
#include <stdio.h>
float a;
double b;
main()
{
a =3D b =3D 0.555555555555555555;
printf("real %.28f\n",a);
printf("double %.28f\n",b);
}
gives:
real 0.5555555820465087890625000000
double 0.5555555555555555802271783250
-----
For C double has higher resolution, but for fortran=20
there is no differece. I have tried various
compiler flags without luck !
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* fortran/10188: gcc test.c or g77 test.f -malign-double
@ 2003-03-22 0:56 bording
0 siblings, 0 replies; 3+ messages in thread
From: bording @ 2003-03-22 0:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 10188
>Category: fortran
>Synopsis: gcc test.c or g77 test.f -malign-double
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 22 00:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: bording@bnl.gov
>Release: gcc-3.2.7
>Organization:
>Environment:
Red-Hat 8.0 on Pentium Pro
>Description:
It seems double precision is not used:
----fortran code----
real a
double precision b
a = 0.555555555555555555
b = 0.555555555555555555
write(6,1) a
write(6,2) b
1 format('real ',f30.28)
2 format('double ',f30.28)
end
gives :
real 0.5555555820465087890625000000
double 0.5555555820465087890625000000
------C code -----
#include <stdio.h>
float a;
double b;
main()
{
a = b = 0.555555555555555555;
printf("real %.28f\n",a);
printf("double %.28f\n",b);
}
gives:
real 0.5555555820465087890625000000
double 0.5555555555555555802271783250
-----
For C double has higher resolution, but for fortran
there is no differece. I have tried various
compiler flags without luck !
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-22 13:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 13:40 fortran/10188: gcc test.c or g77 test.f -malign-double toon
-- strict thread matches above, loose matches on Subject: below --
2003-03-22 1:16 Billinghurst, David (CRTS)
2003-03-22 0:56 bording
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).