[Patch, fortran] PR40011 - Problems with -fwhole-file
Paul Richard Thomas
paul.richard.thomas@gmail.com
Thu Jul 23 23:15:00 GMT 2009
This patch bootstraps and regtests without -fwhole-file. When
regtested with -fwhole-file it fails on legacy features or wrong code
in the tests. I will eliminate the latter as the next step. I have
yet to go through it with a fine toothed comb to be sure that clean up
is OK nor have I prepared the ChangeLogs.
The following fails at any level of optimization with or without
-fwhole-file but is OK in 4.4.1. I cannot tell yet if I have done
something wrong or if the fault is downstream from the fortran
front-end (ie. I have not yet reverted the patch to check). Nor have
I checked if it is expected to pass according to the standard:
! { dg-do run }
! { dg-options "-fwhole-file -O3" }
! Check that the derived types are correctly substituted when
! using whole file compilation.
!
! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr
!
module global
type :: mytype
type(mytype),pointer :: this
end type mytype
type(mytype),target :: base
end module global
program test_equi
use global
call check()
if (.not.associated(base%this%this,base)) call abort
if (.not.associated(base%this%this)) call abort
if (.not.associated(base%this)) call abort
contains
subroutine check()
type(mytype),target :: j
base%this => j !have the variables point
j%this => base !to one another
end subroutine check !take j out of scope
end program test_equi
! { dg-final { cleanup-modules "global" } }
With earlier versions of gcc, the conditions are optimized away
completely but now there is a strange remnant that fails.
Enjoy!
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit1.diff
Type: text/x-patch
Size: 25515 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090723/3c5568cf/attachment.bin>
More information about the Gcc-patches
mailing list