This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
A patch to fix the most obvious failures with -fwhole-file
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Mon, 14 Dec 2009 15:15:27 +0100
- Subject: A patch to fix the most obvious failures with -fwhole-file
Hi all,
I have sent the following patch to Paul, but he his busy with
more important matter. On IRC Richard Guenther said that it
can help to reduce the cluter of some tests (see
http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg01179.html ).
Could I get some comments on the following patch.
TIA
Dominique
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 2007-11-07 10:26:16.000000000 +0100
+++ gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 2009-07-28 04:07:47.000000000 +0200
@@ -22,7 +22,7 @@ end subroutine gfcbug34
! This is PR25669
subroutine foo (a)
real a(*)
- call bar (a, LBOUND(a),2)
+ call bar (a, LBOUND(a,1),2)
end subroutine foo
subroutine bar (b, i, j)
real b(i:j)
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 2008-02-25 10:57:36.000000000 +0100
+++ gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 2009-08-03 19:15:35.000000000 +0200
@@ -105,6 +105,9 @@ subroutine foo(a)
integer :: i
complex :: z
+ i = 1
+ z = (1.0,1.0)
+
! Integer
call gee_i(i**0_1)
call gee_i(i**1_1)
@@ -139,16 +142,16 @@ subroutine foo(a)
call gee_i(i**(-huge(0_4)))
call gee_i(i**(-huge(0_4)-1_4))
- call gee_i(i**0_8)
- call gee_i(i**1_8)
- call gee_i(i**2_8)
- call gee_i(i**3_8)
- call gee_i(i**(-1_8))
- call gee_i(i**(-2_8))
- call gee_i(i**(-3_8))
- call gee_i(i**huge(0_8))
- call gee_i(i**(-huge(0_8)))
- call gee_i(i**(-huge(0_8)-1_8))
+ call gee_i(int(i**0_8,kind=kind(i)))
+ call gee_i(int(i**1_8,kind=kind(i)))
+ call gee_i(int(i**2_8,kind=kind(i)))
+ call gee_i(int(i**3_8,kind=kind(i)))
+ call gee_i(int(i**(-1_8),kind=kind(i)))
+ call gee_i(int(i**(-2_8),kind=kind(i)))
+ call gee_i(int(i**(-3_8),kind=kind(i)))
+ call gee_i(int(i**huge(0_8),kind=kind(i)))
+ call gee_i(int(i**(-huge(0_8)),kind=kind(i)))
+ call gee_i(int(i**(-huge(0_8)-1_8),kind=kind(i)))
! Real
call gee_r(a**0_1)
@@ -243,12 +246,15 @@ end subroutine foo
subroutine gee_i(i)
integer :: i
+ if (i == 0) call abort()
end subroutine gee_i
subroutine gee_r(r)
real :: r
+ if (r == 0.0) call abort()
end subroutine gee_r
subroutine gee_z(c)
complex :: c
+ if (c == (0.0,0.0)) call abort()
end subroutine gee_z
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/loc_1.f90 gcc/testsuite/gfortran.dg/loc_1.f90
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/loc_1.f90 2007-11-07 10:26:26.000000000 +0100
+++ gcc/testsuite/gfortran.dg/loc_1.f90 2009-05-05 10:38:21.000000000 +0200
@@ -13,13 +13,16 @@ end program test
subroutine fn
common /targ/targ
integer targ(10)
+ print *, kind(loc (targ(1)))
call foo (loc (targ)) ! Line that caused ICE
end subroutine fn
subroutine foo (ii)
common /targ/targ
integer targ(10)
- integer ii
+ integer, parameter :: kl = kind(loc (targ(1)))
+ integer(kl) :: ii
+ print *, kl
targ(2) = ii
end subroutine foo
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/pr37243.f gcc/testsuite/gfortran.dg/pr37243.f
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/pr37243.f 2009-01-06 18:14:39.000000000 +0100
+++ gcc/testsuite/gfortran.dg/pr37243.f 2009-08-03 16:19:12.000000000 +0200
@@ -53,10 +53,16 @@
call schmd(V, 1, 18, 18)
end
- subroutine DAXPY
+ subroutine DAXPY(N,DUM,V,M,W,L)
+ IMPLICIT DOUBLE PRECISION(A-H,O-Z)
+ integer N, M, L
+ DIMENSION V(N), W(N)
end
- FUNCTION DDOT ()
+ FUNCTION DDOT(N,V,M,W,L)
+ IMPLICIT DOUBLE PRECISION(A-H,O-Z)
+ integer N, M, L
+ DIMENSION V(N), W(N)
DOUBLE PRECISION DDOT
DDOT = 1
end
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/sizeof.f90 gcc/testsuite/gfortran.dg/sizeof.f90
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/sizeof.f90 2007-11-07 10:26:11.000000000 +0100
+++ gcc/testsuite/gfortran.dg/sizeof.f90 2009-07-28 15:24:42.000000000 +0200
@@ -82,7 +82,7 @@ subroutine check_derived ()
call abort
end subroutine check_derived
-call check_int ()
-call check_real ()
+call check_int (1)
+call check_real (1.0,(/(1.0,i=1,5)/))
call check_derived ()
end
diff -up ../_gcc_clean/gcc/testsuite/gfortran.dg/g77/970625-2.f gcc/testsuite/gfortran.dg/g77/970625-2.f
--- ../_gcc_clean/gcc/testsuite/gfortran.dg/g77/970625-2.f 2007-11-07 10:25:55.000000000 +0100
+++ gcc/testsuite/gfortran.dg/g77/970625-2.f 2009-07-28 15:31:27.000000000 +0200
@@ -50,7 +50,7 @@
END ! DO
SUBROUTINE FUNCTION PROGRAM (REAL,INTEGER, LOGICAL)
LOGICAL REAL
- REAL LOGICAL
+! REAL LOGICAL
INTEGER INTEGER, STOP, RETURN, GO TO
ASSIGN 9 TO STOP ! { dg-warning "ASSIGN" "" }
ASSIGN = 9 + LOGICAL