From abf4d60b541534d42af4e36f723273737164ea38 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 10 Mar 2010 19:56:46 +0100 Subject: [PATCH] 2010-03-10 Tobias Burnus result. 2010-03-10 Tobias Burnus result. + 2010-03-08 Janus Weil PR fortran/43256 * resolve.c (resolve_compcall): Don't set 'value.function.name' here for TBPs, otherwise they will not be resolved properly. (resolve_function): Use 'value.function.esym' instead of - 'value.function.name' to check if we're dealing with a TBP. + 'value.function.name' to check if we're dealing with a TBP. (check_class_members): Set correct type of passed object for all TBPs, not only generic ones, except if the type is abstract. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index e363c5e27038..0cbbacc23084 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -4502,6 +4502,8 @@ get_iso_c_sym (gfc_symbol *old_sym, char *new_name, new_symtree->n.sym->module = gfc_get_string (old_sym->module); new_symtree->n.sym->from_intmod = old_sym->from_intmod; new_symtree->n.sym->intmod_sym_id = old_sym->intmod_sym_id; + if (old_sym->attr.function) + new_symtree->n.sym->result = new_symtree->n.sym; /* Build the formal arg list. */ build_formal_args (new_symtree->n.sym, old_sym, add_optional_arg); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0b8ec9126980..9e4df9afad57 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-03-10 Tobias Burnus PR debug/36728 diff --git a/gcc/testsuite/gfortran.dg/c_assoc_3.f90 b/gcc/testsuite/gfortran.dg/c_assoc_3.f90 new file mode 100644 index 000000000000..0aceb42ec5bf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c_assoc_3.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! +! PR fortran/43303 +! +! Contributed by Dennis Wassel +! +PROGRAM c_assoc + use iso_c_binding + type(c_ptr) :: x + x = c_null_ptr + print *, C_ASSOCIATED(x) ! <<< was ICEing here + if (C_ASSOCIATED(x)) call abort () +END PROGRAM c_assoc -- 2.47.2