[Patch, fortran/testsuite, committed] Fix test case on systems with 32bit pointers (PR 37399)

Tobias Burnus burnus@net-b.de
Sat Sep 6 18:32:00 GMT 2008


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




More information about the Fortran mailing list