------- Comment #3 from janus at gcc dot gnu dot org 2010-08-01 12:39 ------- Many of these failures are actually due to 'gfc_copy_formal_args' and can be fixed with:
Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (revision 162794) +++ gcc/fortran/symbol.c (working copy) @@ -4030,6 +4030,9 @@ gfc_copy_formal_args (gfc_symbol *dest, gfc_symbol gfc_formal_arglist *formal_prev = NULL; /* Save current namespace so we can change it for formal args. */ gfc_namespace *parent_ns = gfc_current_ns; + + if (!src->formal) + return; /* Create a new namespace, which will be the formal ns (namespace of the formal args). */ @@ -4070,6 +4073,8 @@ gfc_copy_formal_args (gfc_symbol *dest, gfc_symbol dest->formal_ns = gfc_current_ns; /* Restore the current namespace to what it was on entry. */ gfc_current_ns = parent_ns; + + gfc_commit_symbols (); } @@ -4181,6 +4186,8 @@ gfc_copy_formal_args_ppc (gfc_component *dest, gfc dest->formal_ns = gfc_current_ns; /* Restore the current namespace to what it was on entry. */ gfc_current_ns = parent_ns; + + gfc_commit_symbols (); } With this patch, the remaining failures are: FAIL: gfortran.dg/bind_c_dts_3.f03 -O (internal compiler error) FAIL: gfortran.dg/c_assoc_2.f03 -O (internal compiler error) FAIL: gfortran.dg/c_ptr_tests_5.f03 -O (internal compiler error) FAIL: gfortran.dg/finalize_3.f03 -O (internal compiler error) FAIL: gfortran.dg/function_kinds_5.f90 -O (internal compiler error) FAIL: gfortran.dg/proc_ptr_result_2.f90 -O (internal compiler error) -- janus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu dot org Target Milestone|4.6.0 |--- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45151