Hi, the following program fails to compile with rev.128283 but used to work just a few days ago: % cat gfcbug70.f90 module foo implicit none public chk type mytype character(len=4) :: str end type mytype type (mytype) ,parameter :: chk (1) = (/ mytype ("abcd") /) end module foo module gfcbug70 use foo, only: chk_ => chk implicit none contains subroutine chk (i) integer, intent(in) :: i print *, chk_(i)% str end subroutine chk end module gfcbug70 I get: /tmp/ccnnONGa.s: Assembler messages: /tmp/ccnnONGa.s:19: Error: symbol `__gfcbug70_MOD_chk' is already defined
Works: gcc version 4.3.0 20070905 (experimental) [trunk revision 128123] (GCC) Fails: gcc version 4.3.0 20070906 (experimental) [trunk revision 128175] (GCC)
The regression is caused by http://gcc.gnu.org/ml/gcc-cvs/2007-09/msg00124.html 2007-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/31564 (PR31564) * primary.c (gfc_match_rvalue): Make expressions that refer to derived type parameters that have array references into variable expressions. Remove references to use association from the symbol. PR fortran/33241 (PR33241) * decl.c (add_init_expr_to_sym): Provide assumed character length parameters with the length of the initialization expression, if a constant, or that of the first element of an array.
Hi Harald! The number of your testcase is depressing but I'll take it on anyway; it's related to PR33337, as well as PR31564, whose patch caused this regression. There is some wierdness going on with name-mangling that I am sure is the cause. Cheers Paul
It's mine. Paul
(In reply to comment #4) > It's mine. > > Paul > The patch has been posted on the list. http://gcc.gnu.org/ml/fortran/2007-09/msg00378.html Paul
Subject: Bug 33376 Author: pault Date: Sat Sep 22 15:46:41 2007 New Revision: 128672 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128672 Log: 2007-09-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/33337 PR fortran/33376 * trans-decl.c (gfc_create_module_variable): Output derived type parameters. * arith.c (gfc_parentheses): Return the argument if it is a constant expression. * primary.c (gfc_match_rvalue): Remove the clearing of the module name and the use_assoc attribute for derived type parameter expressions. 2007-09-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/33337 * gfortran.dg/derived_comp_array_ref_3.f90: New test. PR fortran/33376 * gfortran.dg/derived_comp_array_ref_4.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/derived_comp_array_ref_3.f90 trunk/gcc/testsuite/gfortran.dg/derived_comp_array_ref_4.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/arith.c trunk/gcc/fortran/primary.c trunk/gcc/fortran/trans-decl.c trunk/gcc/testsuite/ChangeLog
Fixed on trunk. Thanks, Harald. Paul