When compiled with -fdefault-integer-8, maxloc_bounds_[457].f90 give the
following error:

/opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90:19.11:

  call foo(res)
          1
Error: Type mismatch in argument 'res' at (1); passed INTEGER(4) to INTEGER(8)

A possible fix is to apply a patch such as:

--- /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90  
2008-02-25 10:57:38.000000000 +0100
+++ maxloc_bounds_4_db.f90      2008-04-14 22:31:25.000000000 +0200
@@ -5,7 +5,7 @@
 contains
   subroutine foo(res)
     integer(kind=4), allocatable :: f(:,:)
-    integer, dimension(:) :: res
+    integer(kind=4), dimension(:) :: res
     allocate (f(2,5))
     f = 3
     res = maxloc(f)

or

--- /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90  
2008-02-25 10:57:38.000000000 +0100
+++ maxloc_bounds_4_db_1.f90    2008-04-14 22:48:38.000000000 +0200
@@ -4,7 +4,7 @@
 module tst
 contains
   subroutine foo(res)
-    integer(kind=4), allocatable :: f(:,:)
+    integer, allocatable :: f(:,:)
     integer, dimension(:) :: res
     allocate (f(2,5))
     f = 3
@@ -15,7 +15,7 @@
 program main
   use tst
   implicit none
-  integer(kind=4) :: res(3)
+  integer :: res(3)
   call foo(res)
 end program main
 ! { dg-output "Fortran runtime error: Incorrect extent in return value of
MAXLOC intrnisic: is 3, should be 2" }

in order to have consistent integer definitions.


-- 
           Summary: maxloc_bounds_[457].f90 fail with -fdefault-integer-8
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35939

Reply via email to