This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Fortran -fwhole-file patch
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Sun, 12 Jul 2009 10:27:00 +0200
- Subject: Re: Fortran -fwhole-file patch
- References: <339c37f20907120102h40764164ia393a3c0ad2418a1@mail.gmail.com>
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.