------- Comment #6 from paul dot richard dot thomas at cea dot fr 2006-08-11 14:08 ------- Created an attachment (id=12066) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12066&action=view) Prototype fix
The attached runs the testcase below correctly and regtests, except for gfortran.fortran-torture/execute/entry_5.f90, on Cygwin_NT/PIV. I have not had enough time to really check with it is necessary and sufficient, to fix this one regression nor have I had time to track down the cause of an irritating but apparently harmless wrinkle - the declaration char z[1:.z] appears twice; the first time with an incorrect .z and the second with the correct value for .z. Fortunately, it is the second declaration that is seen in the scope of the executable code. As of tomorrow, I am back on the road again until the end of next week. If you want to run with this, please do. Otherwise, I will complete the job upon my return. All the best Paul PS I have made some progress on allocatable component derived type constructors. PPS This works with the patch: program runoptf90 implicit none real :: x(10) call simulated_annealing1 (x) call simulated_annealing2 (x) call simulated_annealing3 (x) contains subroutine simulated_annealing1 (xmin) real, intent(inout) :: xmin(:) real :: x(size(xmin)+1) real :: r(size(x)-2) xmin = r print *, "#1 ", size(r), size(x) end subroutine simulated_annealing1 subroutine simulated_annealing2 (xmin) real, intent(inout) :: xmin(:) real :: x(size(xmin)+3) real :: zr(size(x)-6) xmin = zr print *, "#2 ", size(zr), size(x) end subroutine simulated_annealing2 subroutine simulated_annealing3 (xmin) real, intent(inout) :: xmin(:) character(size(x)+2) :: y ! host associated x character(len(y)+3) :: z real :: r(len(z)-10) xmin = r print *, "#3 ", size(r), len(z) end subroutine simulated_annealing3 end program runoptf90 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28660