This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch, fortran/testsuite, committed] Fix test case on systems with 32bit pointers (PR 37399)
- From: Tobias Burnus <burnus at net-b dot de>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sat, 06 Sep 2008 20:32:04 +0200
- Subject: [Patch, fortran/testsuite, committed] Fix test case on systems with 32bit pointers (PR 37399)
This fixes my previous test case, where
allocate(array(something_HUGE))
was used. The something_HUGE was a 64-bit variable which gets converted
to 32bit for systems with 32bit pointers.
As the variable overflows, an error is printed. There are two solutions:
(a) Using -fno-range-check, (b) comment the statement. I have decided to
do the latter (does not really matter, it is a compile-time check only).
I've committed the following patch as obvious. Thanks to HJ for finding it.
Tobias
Index: ChangeLog
===================================================================
--- ChangeLog (Revision 140069)
+++ ChangeLog (Arbeitskopie)
@@ -1,3 +1,9 @@
+2008-09-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37399
+ * gfortran.dg/size_kind.f90: Remove allocate statement
+ as it overflows at compile time on 32bit systems.
+
2008-09-06 Jan Hubicka <jh@suse.cz>
* g++.dg/tree-ssa-pr14703.C: New testcase.
Index: gfortran.dg/size_kind.f90
===================================================================
--- gfortran.dg/size_kind.f90 (Revision 140069)
+++ gfortran.dg/size_kind.f90 (Arbeitskopie)
@@ -19,7 +19,9 @@
print *, "max_32 = ", max_32
print *, "big_sz = ", big_sz
- allocate(array(big_sz))
+! Disabled as it overflows on 32bit systems (at compile time)
+! (conversion of integer(8) to integer(4))
+! allocate(array(big_sz))
print *, "sz = ", size(array)
print *, "sz = ", size(array, kind=long)
end program