Commit 568eecad by Daniel Franke

resolve.c (resolve_global_procedure): Enable whole-file checking for procedures…

resolve.c (resolve_global_procedure): Enable whole-file checking for procedures that are declared later in the file.

gcc/fortran/:
2009-04-11  Daniel Franke  <frake.daniel@gmail.com>

        * resolve.c (resolve_global_procedure): Enable whole-file checking for
        procedures that are declared later in the file.


gcc/testsuite:
2009-04-11  Daniel Franke  <franke.daniel@gmail.com>

        * gfortran.dg/whole_file_5.f90: New.
        * gfortran.dg/whole_file_6.f90: New.

From-SVN: r145953
parent 8810712e
2009-04-11 Daniel Franke <frake.daniel@gmail.com>
* resolve.c (resolve_global_procedure): Enable whole-file checking for
procedures that are declared later in the file.
2009-04-10 Paolo Bonzini <bonzini@gnu.org>
PR middle-end/39701
......
......@@ -1610,8 +1610,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (gfc_option.flag_whole_file
&& gsym->type != GSYM_UNKNOWN
&& gsym->ns
&& gsym->ns->proc_name
&& gsym->ns->proc_name->formal)
&& gsym->ns->proc_name)
{
/* Make sure that translation for the gsymbol occurs before
the procedure currently being resolved. */
......
2009-04-11 Daniel Franke <franke.daniel@gmail.com>
* gfortran.dg/whole_file_5.f90: New.
* gfortran.dg/whole_file_6.f90: New.
2009-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39713
......
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
!
! Check that inlining of functions declared BEFORE usage works.
! If yes, then the dump does not contain a call to F().
!
INTEGER FUNCTION f()
f = 42
END FUNCTION
PROGRAM main
INTEGER :: a
a = f()
print *, a
END PROGRAM
! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } }
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
!
! Check that inlining of functions declared AFTER usage works.
! If yes, then the dump does not contain a call to F().
!
PROGRAM main
INTEGER :: a(3)
a = f()
print *, a
END PROGRAM
INTEGER FUNCTION f()
f = 42.0
END FUNCTION
! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment