Fun testcase: gfortran -c bug.f90 f951: internal compiler error: in find_typebound_proc_uop, at fortran/symbol.c:4575 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. > cat bug.f90 TYPE qs_scf_env_type TYPE(preconditioner_p_type), DIMENSION(:), POINTER :: ot_preconditioner END TYPE qs_scf_env_type TYPE(qs_scf_env_type), POINTER :: scf_env CALL destroy_preconditioner(scf_env%ot_preconditioner(i)%preconditioner,error=error)
'reduced' testcase > cat test.f90 TYPE a TYPE(b), DIMENSION(:), POINTER :: c END TYPE TYPE(a), POINTER :: d CALL X(d%c%e)
That's a regression with regards to 4.3. There one get's the following error message. (I think the error messages would be clearer if they were reversed.) ahjf.f90:5.12: CALL X(d%c%e) 1 Error: Derived type 'b' at (1) is being used before it is defined ahjf.f90:2.37: TYPE(b), DIMENSION(:), POINTER :: c 1 Error: The pointer component 'c' of 'a' at (1) is a type that has not been declared
Created attachment 18504 [details] Fix for the PR As soon as it has finished regtesting, I will commit as 'obvious'. Paul
Subject: Bug 41258 Author: pault Date: Sat Sep 5 14:20:51 2009 New Revision: 151451 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151451 Log: 2009-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41258 * primary.c (gfc_match_varspec): Do not look for typebound procedures unless the derived type has a f2k_derived namespace. 2009-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41258 * gfortran.dg/typebound_proc_12.f90 : New test. Added: trunk/gcc/testsuite/gfortran.dg/typebound_proc_12.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/primary.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 41258 Author: pault Date: Sat Sep 5 14:25:39 2009 New Revision: 151452 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151452 Log: 2009-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41258 * primary.c (gfc_match_varspec): Do not look for typebound procedures unless the derived type has a f2k_derived namespace. 2009-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41258 * gfortran.dg/typebound_proc_12.f90 : New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/typebound_proc_12.f90 Modified: branches/gcc-4_4-branch/gcc/fortran/ChangeLog branches/gcc-4_4-branch/gcc/fortran/primary.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed on trunk and 4.4. Joost, many thanks for the report. Paul
Thanks for fixing this, I guess this was my fault (without looking further)... I was away over the weekend, but should be able to do some hacking again now ;)