This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fortran -fwhole-file patch


On Sun, Jul 12, 2009 at 10:02 AM, Paul Richard
Thomas<paul.richard.thomas@gmail.com> wrote:
> Dear Richi,
>
> I am down to two fundamental problems with the whole-file patch that
> I cannot see a solution to. ?I have dealt with Dominique's wrinkles
> and the rest of the testsuite failures are due to non-conformity
> with F95.
>
> (i) gfortran/import.f90
>
> Consider this reduced version. ?It compiles and runs OK at -O3 with
> the PRINT statement in 'test' but aborts in the main program without
> it.
>
> subroutine test(x)
> ?type myType3
> ? ?sequence
> ? ?integer :: i
> ?end type myType3
> ?type(myType3) :: x
> ?if(x%i /= 7) call abort()
> ?x%i = 1
> ! ?print *, "x"
> end subroutine test
>
>
> program foo
> ?type myType3
> ? ?sequence
> ? ?integer :: i
> ?end type myType3
> ?interface
> ? ?subroutine test(x)
> ? ? ?import :: myType3
> ? ? ?type(myType3) :: x
> ? ?end subroutine test
> ?end interface
>
> ?type(myType3) :: z
> ?z%i = 7
> ?call test(z)
> ?if(z%i /= 1) call abort
> end program foo

This looks like the testcase in comment #13 from PR38913.  The issue
here is that the two sequence types are not compatible (they are
neither the same type tree nor a variant type of each other nor is one
the canonical type of the other).  This then causes miscompiles with
strict-aliasing (thus -O1 works, but likely -O1 -fstrict-aliasing does not).

Is your current patch still the one you posted two weeks ago?

Thanks,
Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]