This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
peculiar behavior: 64 byte integer in g77 and gfortran
- From: wangbin at shgentai dot com
- To: fortran at gcc dot gnu dot org
- Date: Fri, 15 Aug 2008 09:26:52 -0000 (GMT)
- Subject: peculiar behavior: 64 byte integer in g77 and gfortran
Dear Respected,
I am now compling some fortran program with g77 and gfortran, the
platform is CentOs5 X86_64 SMP, AMD di-core hard architechture.
When I compling the following program, I can not get the right
answer.
The two piece of codes are,
fortran77 form
ex1.for:
integer *8 a,b
a=2**60
b=%loc(a)
print *,a,b
end
ex2.f90:
integer *8 a
a=2**60
print *,a
end
When I compile ex1 with "g77 ex1.for", I get the result of a is
zero and b is a nonzero integer which corresponding to address of
a. When I compile it with gfortran, the complier gfortran tell me
2**60 is oarithhematic overrflow.
The second code is in the same condition.
Who can please tell me what I can do to solve this problem?
yours
bin wang