No time to reduce this one, filing it so it doesn't get lost: module cyclic implicit none contains function ouch(x,y) implicit character(len(ouch)) (x) implicit character(len(x)+1) (y) implicit character(len(y)-1) (o) intent(in) x,y character(len(y)-1) ouch integer i do i = 1, len(ouch) ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) end do end function ouch end module cyclic program test use cyclic implicit none write(*,*) ouch('YOW!',' ') end program test
This is a case of cyclic specification so I have changed the keyword to ice-on-ivalid. Confirmed Paul
*** Bug 31294 has been marked as a duplicate of this bug. ***
backtrace is uggly, repeats the following for a long long time #3554 0x000000000043c63e in mio_expr (ep=<value optimized out>) at ../../gcc43/gcc/fortran/module.c:2133 #3555 0x000000000043c779 in mio_expr (ep=0xef2f60) at ../../gcc43/gcc/fortran/module.c:2685 #3556 0x000000000043c8dd in mio_charlen (clp=0xf31728) at ../../gcc43/gcc/fortran/module.c:1769 #3557 0x000000000043c979 in mio_typespec (ts=0xf31718) at ../../gcc43/gcc/fortran/module.c:1831 #3558 0x000000000043c393 in mio_expr (ep=0xef2a38) at ../../gcc43/gcc/fortran/module.c:2649 #3559 0x000000000043c9ad in mio_actual_arg (a=<value optimized out>) at ../../gcc43/gcc/fortran/module.c:2118 #3560 0x000000000043c63e in mio_expr (ep=<value optimized out>) at ../../gcc43/gcc/fortran/module.c:2133
*** Bug 32488 has been marked as a duplicate of this bug. ***
The problem of the cyclic definition is (more or less), the same described in PR24886, isn't it? E.g. replace implicit character(len(ouch)) (x) implicit character(len(x)+1) (y) intent(in) x,y by character(len=*), intent(in) :: x ! or character(len=n), n integer character(len=len(x)+1), intent(in) :: y to get a working binary. My meaning: "len(ouch)" is not known when defining the length of the dummy argument x, thus it is a length that's different from the actual length.
Subject: Bug number PR31306 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01207.html
Subject: Bug 31306 Author: jvdelisle Date: Sat Oct 27 17:59:59 2007 New Revision: 129685 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129685 Log: 2007-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31306 * decl.c (char_len_param_value): Add check for conflicting attributes of function argument. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c
Subject: Bug 31306 Author: jvdelisle Date: Sat Oct 27 18:25:43 2007 New Revision: 129686 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129686 Log: 2007-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31306 * gfortran.dg/argument_check_7.f90: New test. * gfortran.dg/argument_check_8.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/argument_checking_7.f90 trunk/gcc/testsuite/gfortran.dg/argument_checking_8.f90 Modified: trunk/gcc/testsuite/ChangeLog
Fixed and closing.