fortran/10188: gcc test.c or g77 test.f -malign-double

bording@bnl.gov bording@bnl.gov
Sat Mar 22 03:07:00 GMT 2003


>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:



More information about the Gcc-bugs mailing list