diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e485e726a9782fb7d67163ba313e1fdd05ff2816..68c4b7a0728c1e74d01d9879d80c248d65ccf257 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-07-24 Tobias Burnus <burnus@net-b.de> + + * options.c (gfc_init_options): Enable -fwhole-file by default. + * interface.c (compare_parameter): Assume a Hollerith constant is + compatible with all other argument types. + 2010-07-23 Tobias Burnus <burnus@net-b.de> PR fortran/44945 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 201961d63557fba9f37a8f642acf1fa98bda6c4a..4ffe5ee33fb21e70c040adae7ccd21a05b441c70 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1470,6 +1470,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, } if ((actual->expr_type != EXPR_NULL || actual->ts.type != BT_UNKNOWN) + && actual->ts.type != BT_HOLLERITH && !gfc_compare_types (&formal->ts, &actual->ts)) { if (where) diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index d5c6c3caf90cc9ed2afbd0bdd896917c94ab8472..5ba2544392a1038b144a6fb9e902b676210a9a07 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -96,7 +96,7 @@ gfc_init_options (unsigned int argc, const char **argv) gfc_option.flag_default_real = 0; gfc_option.flag_dollar_ok = 0; gfc_option.flag_underscoring = 1; - gfc_option.flag_whole_file = 0; + gfc_option.flag_whole_file = 1; gfc_option.flag_f2c = 0; gfc_option.flag_second_underscore = -1; gfc_option.flag_implicit_none = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4083476e2549b40f04a97f55c6296edb69c73929..32d20170834147bb3029fe7089d3f8518acbd2c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,26 @@ +2010-07-24 Tobias Burnus <burnus@net-b.de> + + * gfortran.dg/func_decl_4.f90: Split test into two ... + * gfortran.dg/func_decl_5.f90: ... parts. + * gfortran.dg/common_resize_1.f: xfail two warnings (cf. PR 45045). + * gfortran.dg/bounds_temporaries_1.f90: Add new dg-warning. + * gfortran.dg/global_references_1.f90: Add new dg-warning. + * gfortran.dg/generic_actual_arg.f90: Add new dg-warning. + * gfortran.dg/entry_17.f90: Remove no-longer needed dg-warning. + * gfortran.dg/used_before_typed_4.f90: Add new dg-warning. + * gfortran.dg/bounds_check_strlen_1.f90: Add new dg-warning. + * gfortran.dg/intrinsic_std_1.f90: Split by remove tree dump ... + * gfortran.dg/intrinsic_std_6.f90: ... and create a dump test. + * gfortran.dg/sizeof.f90: Make test valid. + * gfortran.dg/pr20865.f90: Add new dg-error. + * gfortran.dg/integer_exponentiation_2.f90: Add new dg-warnings. + * gfortran.dg/g77/19990218-0.f: Ditto. + * gfortran.dg/g77/19990218-1.f: Ditto. + * gfortran.dg/g77/970625-2.f: Ditto. + * gfortran.dg/pr37243.f: Fix function declaration. + * gfortran.dg/use_only_1.f90: Fix implicit typing. + * gfortran.dg/loc_1.f90: Fix pointer datatype. + 2010-07-23 Tobias Burnus <burnus@net-b.de> PR fortran/44945 diff --git a/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 b/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 index 44673024b825eb6776a4e0f8fc54c69d7a45ee91..7ea4a89a1018e28e400eb13cd65f1e28fec99ba7 100644 --- a/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 +++ b/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 @@ -12,7 +12,7 @@ END SUBROUTINE test PROGRAM main IMPLICIT NONE - CALL test ('abc') ! String is too short. + CALL test ('abc') ! { dg-warning "Character length of actual argument shorter" } END PROGRAM main ! { dg-output "shorter than the declared one for dummy argument 'str' \\(3/5\\)" } diff --git a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 index a277566735d4f1c5adda173dd2551de4d2c4b8cc..32bb265c130e0c772becc8f03927f61d7ab7202f 100644 --- a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 +++ b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 @@ -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),2) ! { dg-warning "Rank mismatch in argument" } end subroutine foo subroutine bar (b, i, j) real b(i:j) diff --git a/gcc/testsuite/gfortran.dg/common_resize_1.f b/gcc/testsuite/gfortran.dg/common_resize_1.f index 7d4baaacea6a057c60d1530045a9e2106e863d95..a94c1bc0c6a74e330918f2913f172584f5523bc8 100644 --- a/gcc/testsuite/gfortran.dg/common_resize_1.f +++ b/gcc/testsuite/gfortran.dg/common_resize_1.f @@ -49,14 +49,15 @@ c 7 vy5(lnv),vy6(lnv),vy7(lnv),vy8(lnv), 8 vz1(lnv),vz2(lnv),vz3(lnv),vz4(lnv), 9 vz5(lnv),vz6(lnv),vz7(lnv),vz8(lnv) - common/aux32/ ! { dg-warning "shall be of the same size" } + ! XFAILed here and below because of PRs 45045 and 45044 + common/aux32/ ! { dg-warning "shall be of the same size" "" { xfail *-*-*} } a a17(lnv),a28(lnv),dett(lnv), 1 aj1(lnv),aj2(lnv),aj3(lnv),aj4(lnv), 2 aj5(lnv),aj6(lnv),aj7(lnv),aj8(lnv), 3 aj9(lnv),x17(lnv),x28(lnv),x35(lnv), 4 x46(lnv),y17(lnv),y28(lnv),y35(lnv), 5 y46(lnv),z17(lnv),z28(lnv),z35(lnv),z46(lnv) - common/aux33/ ! { dg-warning "shall be of the same size" } + common/aux33/ ! { dg-warning "shall be of the same size" "" { xfail *-*-*} } a ix1(lnv),ix2(lnv),ix3(lnv),ix4(lnv),ix5(lnv), 1 ix6(lnv),ix7(lnv),ix8(lnv),mxt(lnv),nmel common/aux36/lft,llt diff --git a/gcc/testsuite/gfortran.dg/entry_17.f90 b/gcc/testsuite/gfortran.dg/entry_17.f90 index 22aabb3a88f8cba99c4416ba570365a78a80bfe2..b4e91c2a8eea42977222854837a8b61fe165b20e 100644 --- a/gcc/testsuite/gfortran.dg/entry_17.f90 +++ b/gcc/testsuite/gfortran.dg/entry_17.f90 @@ -24,7 +24,7 @@ function test3() ! { dg-warning "Obsolescent feature" } return entry bar3() bar3 = "" -end function test3 ! { dg-warning "Obsolescent feature" } +end function test3 function test4(n) ! { dg-error "returning variables of different string lengths" } integer :: n @@ -52,4 +52,4 @@ function test6() ! { dg-warning "Obsolescent feature|returning variables of diff return entry bar6() bar6 = "" -end function test6 ! { dg-warning "Obsolescent feature" } +end function test6 diff --git a/gcc/testsuite/gfortran.dg/func_decl_4.f90 b/gcc/testsuite/gfortran.dg/func_decl_4.f90 index 972454dce04b8cb4769671cdd4fb8173576db5e1..edc6c7e25c77cafbd276407fc90f64836c895494 100644 --- a/gcc/testsuite/gfortran.dg/func_decl_4.f90 +++ b/gcc/testsuite/gfortran.dg/func_decl_4.f90 @@ -3,13 +3,18 @@ ! ! Functions shall not have an initializer. ! +! Due to -fwhole-file, the function declaration +! warnings come before the init warnings; thus +! the warning for the WRONG lines have been moved to +! func_decl_5.f90 +! -function f1() ! { dg-error "cannot have an initializer" } - integer :: f1 = 42 +function f1() + integer :: f1 = 42 ! WRONG, see func_decl_5.f90 end function -function f2() RESULT (r) ! { dg-error "cannot have an initializer" } - integer :: r = 42 +function f2() RESULT (r) + integer :: r = 42 ! WRONG, see func_decl_5.f90 end function function f3() RESULT (f3) ! { dg-error "must be different than function name" } diff --git a/gcc/testsuite/gfortran.dg/g77/19990218-0.f b/gcc/testsuite/gfortran.dg/g77/19990218-0.f index 631e74195eadc997c7fd20222e25d5899ec4296a..57bb638411020c25101ad5aa848cb45f052adc15 100644 --- a/gcc/testsuite/gfortran.dg/g77/19990218-0.f +++ b/gcc/testsuite/gfortran.dg/g77/19990218-0.f @@ -2,7 +2,7 @@ c { dg-do compile } program test double precision a,b,c data a,b/1.0d-46,1.0d0/ - c=fun(a,b) + c=fun(a,b) ! { dg-error "Return type mismatch of function" } print*,'in main: fun=',c end double precision function fun(a,b) diff --git a/gcc/testsuite/gfortran.dg/g77/19990218-1.f b/gcc/testsuite/gfortran.dg/g77/19990218-1.f index 2ac43903444dd0596b43694bca22113c96a6c61c..8506e4fe14800ecf8b42bc68fe6a5d3ad05cbc4b 100644 --- a/gcc/testsuite/gfortran.dg/g77/19990218-1.f +++ b/gcc/testsuite/gfortran.dg/g77/19990218-1.f @@ -20,6 +20,6 @@ c program test double precision a,b,c data a,b/1.0d-46,1.0d0/ - c=fun(a,b) + c=fun(a,b) ! { dg-error "Return type mismatch of function" } print*,'in main: fun=',c end diff --git a/gcc/testsuite/gfortran.dg/g77/970625-2.f b/gcc/testsuite/gfortran.dg/g77/970625-2.f index c77a2b5f310bfae6070f3febeb3a9f4dac65ab5d..19bd096815a96fae15c1923b98bb611f4a64e1f6 100644 --- a/gcc/testsuite/gfortran.dg/g77/970625-2.f +++ b/gcc/testsuite/gfortran.dg/g77/970625-2.f @@ -40,7 +40,7 @@ PROGRAM = THEN - IF ELSE IF = THEN .GT. IF IF (THEN.GT.REAL) THEN - CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) + CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) ! { dg-warning "Type mismatch in argument" } ELSE IF (ELSE IF) THEN REAL = THEN + END DO END IF diff --git a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 index 9cf0d8eb00462711fd680855a427831e0939009a..e0b36a010364535d571e3c0334cf5e4dc42cb782 100644 --- a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 +++ b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 @@ -37,7 +37,7 @@ USE TEST USE TEST2 CALL F(CALCULATION) ! { dg-error "GENERIC procedure" } -CALL F(CALCULATION2) ! OK because there is a same name specific +CALL F(CALCULATION2) ! OK because there is a same name specific, but: ! { dg-warning "More actual than formal arguments" } END SUBROUTINE F() diff --git a/gcc/testsuite/gfortran.dg/global_references_1.f90 b/gcc/testsuite/gfortran.dg/global_references_1.f90 index 0e633455518977636e02b9d7e07f46b90a39cc6a..d241aca1b5378a958849d9edaf899d177abb2ad7 100644 --- a/gcc/testsuite/gfortran.dg/global_references_1.f90 +++ b/gcc/testsuite/gfortran.dg/global_references_1.f90 @@ -32,11 +32,11 @@ function h(x) ! { dg-error "is already being used as a FUNCTION" } end function h SUBROUTINE TT() - CHARACTER(LEN=10), EXTERNAL :: j + CHARACTER(LEN=10), EXTERNAL :: j ! { dg-warning "Return type mismatch" } CHARACTER(LEN=10) :: T ! PR20881=========================================================== ! Error only appears once but testsuite associates with both lines. - T = j () ! { dg-error "is already being used as a FUNCTION" } + T = j (1.0) ! { dg-error "is already being used as a SUBROUTINE" } print *, T END SUBROUTINE TT @@ -78,7 +78,7 @@ end ! Lahey - 2636-S: "SOURCE.F90", line 81: ! Subroutine 'j' is previously referenced as a function in 'line 39'. -SUBROUTINE j (x) ! { dg-error "is already being used as a FUNCTION" } +SUBROUTINE j (x) ! { dg-error "is already being used as a SUBROUTINE" } integer a(10) common /bar/ a ! Global entity foo real x diff --git a/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 b/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 index 1261d48d3412bb91b428c4db719d923926e61101..d55f70c9a95b8cfc3a16c74291f95b6805cd17cd 100644 --- a/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 +++ b/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 @@ -139,16 +139,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(i**0_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**1_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**2_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**3_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-1_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-2_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-3_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**huge(0_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-huge(0_8))) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-huge(0_8)-1_8)) ! { dg-warning "Type mismatch in argument" } ! Real call gee_r(a**0_1) diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 index 290b54c2cb449f6131c085f19dfce6b344081ea5..ac8649bbc627465e62672514a11282dee2abd95e 100644 --- a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 +++ b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 @@ -1,5 +1,9 @@ ! { dg-do compile } -! { dg-options "-std=f95 -Wintrinsics-std -fdump-tree-original" } +! { dg-options "-std=f95 -Wintrinsics-std" } + +! +! See intrinsic_std_6.f90 for the dump check. +! ! PR fortran/33141 ! Check for the expected behaviour when an intrinsic function/subroutine is @@ -32,8 +36,8 @@ END SUBROUTINE implicit_type SUBROUTINE specification_expression CHARACTER(KIND=selected_char_kind("ascii")) :: x -! { dg-error "must be an intrinsic function" "" { target "*-*-*" } 34 } -! { dg-warning "Fortran 2003" "" { target "*-*-*" } 34 } +! { dg-error "must be an intrinsic function" "" { target "*-*-*" } 38 } +! { dg-warning "Fortran 2003" "" { target "*-*-*" } 38 } END SUBROUTINE specification_expression SUBROUTINE intrinsic_decl @@ -41,9 +45,3 @@ SUBROUTINE intrinsic_decl INTRINSIC :: atanh ! { dg-error "Fortran 2008" } INTRINSIC :: abort ! { dg-error "extension" } END SUBROUTINE intrinsic_decl - -! Scan that really external functions are called. -! { dg-final { scan-tree-dump " abort " "original" } } -! { dg-final { scan-tree-dump " asinh " "original" } } -! { dg-final { scan-tree-dump " acosh " "original" } } -! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/loc_1.f90 b/gcc/testsuite/gfortran.dg/loc_1.f90 index ef0b1c102800728dde9da580658d7ac196ecf97a..2c070dfb1bbc35f87d4e02312b47b5de882775da 100644 --- a/gcc/testsuite/gfortran.dg/loc_1.f90 +++ b/gcc/testsuite/gfortran.dg/loc_1.f90 @@ -17,9 +17,10 @@ subroutine fn end subroutine fn subroutine foo (ii) + use iso_c_binding, only: c_intptr_t common /targ/targ integer targ(10) - integer ii + integer(c_intptr_t) ii targ(2) = ii end subroutine foo diff --git a/gcc/testsuite/gfortran.dg/pr20865.f90 b/gcc/testsuite/gfortran.dg/pr20865.f90 index 5c26965ccc56dcb7d61c5d6dd2829dd8b8fd83c4..e99eb0bedbfd8e5bc6cdf5063c5a3ae40fc2a385 100644 --- a/gcc/testsuite/gfortran.dg/pr20865.f90 +++ b/gcc/testsuite/gfortran.dg/pr20865.f90 @@ -8,5 +8,5 @@ integer :: i, st st(i) = (i*i+2) - call tt(st) ! { dg-error "Statement function .* is not allowed as an actual argument" } + call tt(st) ! { dg-error "Statement function .* is not allowed as an actual argument|Invalid procedure argument" } end diff --git a/gcc/testsuite/gfortran.dg/pr37243.f b/gcc/testsuite/gfortran.dg/pr37243.f index 01ec0bdf88614e92f1a6404fbabd296561a8bc60..0a606ad77071727a37de254ea5eb2757624ef7ff 100644 --- a/gcc/testsuite/gfortran.dg/pr37243.f +++ b/gcc/testsuite/gfortran.dg/pr37243.f @@ -53,10 +53,13 @@ call schmd(V, 1, 18, 18) end - subroutine DAXPY + subroutine DAXPY(N,D,V,M,W,L) + INTEGER :: N, M, L + DOUBLE PRECISION D, V(1,1), W(1,1) end - FUNCTION DDOT () - DOUBLE PRECISION DDOT + FUNCTION DDOT (N,V,M,W,L) + INTEGER :: N, M, L + DOUBLE PRECISION DDOT, V(1,1), W(1,1) DDOT = 1 end diff --git a/gcc/testsuite/gfortran.dg/sizeof.f90 b/gcc/testsuite/gfortran.dg/sizeof.f90 index 5518ba22491192102de0ff940bb622f5328282c5..fbe6b868fb0e200f606d39cf030fcb1ec21fac66 100644 --- a/gcc/testsuite/gfortran.dg/sizeof.f90 +++ b/gcc/testsuite/gfortran.dg/sizeof.f90 @@ -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, 2.0, 3.0, 4.0, 5.0/)) call check_derived () end diff --git a/gcc/testsuite/gfortran.dg/use_only_1.f90 b/gcc/testsuite/gfortran.dg/use_only_1.f90 index 30808fb856fa1f2325467f6ab2c6b0b3e9eee4c4..e0132438416641e9e25b6e2958f54f71e62d64aa 100644 --- a/gcc/testsuite/gfortran.dg/use_only_1.f90 +++ b/gcc/testsuite/gfortran.dg/use_only_1.f90 @@ -73,6 +73,7 @@ contains USE xmod, ONLY: xfoobar_renamed => xfoobar USE ymod, ONLY: yfoobar_renamed => yfoobar USE ymod + implicit integer(4) (a-z) if (xfoobar_renamed (42) == xfoobar ()) call abort () if (yfoobar_renamed (42) == yfoobar ()) call abort () end subroutine diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 index 9d7ccc10add4d83dc171ea6c16a437ebeccd1b35..ff8a1fc2970e69753b33f1567c28e40d4cf7153e 100644 --- a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 +++ b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 @@ -22,5 +22,5 @@ END SUBROUTINE test PROGRAM main IMPLICIT NONE INTEGER :: arr1(42), arr2(42) - CALL test (3, arr1, 2, arr2) + CALL test (3, arr1, 2, arr2) ! { dg-warning "Type mismatch in argument" } END PROGRAM main diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 127b500b355eae5df62fffc8afe65eae63ae40f9..3ca2ac4e80be832f48e524c7284b23a62572f7f4 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2010-07-24 Tobias Burnus <burnus@net-b.de> + + * testsuite/libgomp.fortran/appendix-a/a.28.5.f90: Add -w to + silence -fwhole-file warning. + 2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * configure.tgt (*-*-solaris2.[56]*): Removed. diff --git a/libgomp/testsuite/libgomp.fortran/appendix-a/a.28.5.f90 b/libgomp/testsuite/libgomp.fortran/appendix-a/a.28.5.f90 index e3775822f108d7c49e8ba1a4ac8a0e8099b46ed8..08de997f8c48f1e2af109179d201fad3be21e583 100644 --- a/libgomp/testsuite/libgomp.fortran/appendix-a/a.28.5.f90 +++ b/libgomp/testsuite/libgomp.fortran/appendix-a/a.28.5.f90 @@ -1,4 +1,9 @@ ! { dg-do compile } +! { dg-options "-w" } +! +! "-w" added as libgomp/testsuite seemingly cannot parse with +! dg-warning Fortran's output. Fortran warns for "call sub1(a)" +! that there is a "Rank mismatch in argument 'x'". SUBROUTINE SUB1(X) DIMENSION X(10)