OSDN Git Service

2010-03-10 Tobias Burnus <burnus@net-b.de
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Mar 2010 18:56:46 +0000 (18:56 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Mar 2010 18:56:46 +0000 (18:56 +0000)
        PR fortran/43303
        * symbol.c (get_iso_c_sym): Set sym->result.

2010-03-10  Tobias Burnus  <burnus@net-b.de

        PR fortran/43303
        * gfortran.dg/c_assoc_3.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157364 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/c_assoc_3.f90 [new file with mode: 0644]

index 8165bb1..f9bde00 100644 (file)
@@ -1,10 +1,15 @@
+2010-03-10  Tobias Burnus  <burnus@net-b.de
+
+       PR fortran/43303
+       * symbol.c (get_iso_c_sym): Set sym->result.
+
 2010-03-08  Janus Weil  <janus@gcc.gnu.org>
 
        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.
 
index e363c5e..0cbbacc 100644 (file)
@@ -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);
 
index 0b8ec91..9e4df9a 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-10  Tobias Burnus  <burnus@net-b.de
+
+       PR fortran/43303
+       * gfortran.dg/c_assoc_3.f90: New test.
+
 2010-03-10  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..0aceb42
--- /dev/null
@@ -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