]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/59023 (ICE in gfc_search_interface with BIND(C))
authorJanus Weil <janus@gcc.gnu.org>
Mon, 6 Jan 2014 11:31:34 +0000 (12:31 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Mon, 6 Jan 2014 11:31:34 +0000 (12:31 +0100)
2014-01-06  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59023
PR fortran/59662
* resolve.c (resolve_global_procedure): Don't apply to c-binding
procedures.
(gfc_verify_binding_labels): Remove duplicate line.

2014-01-06  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59023
* gfortran.dg/bind_c_procs_2.f90: New.

From-SVN: r206355

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

index 40a26dba6326cd15e4df5e15558d7c715b711d04..5f24087d120abacc8b9e8b75da144a2691056fe0 100644 (file)
@@ -1,3 +1,11 @@
+2014-01-06  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59023
+       PR fortran/59662
+       * resolve.c (resolve_global_procedure): Don't apply to c-binding
+       procedures.
+       (gfc_verify_binding_labels): Remove duplicate line.
+
 2014-01-04  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/59547
index 0e80f491abc7c759f8445ff86ebfa386d2ba0e8a..e78788b8de4cccfc1ac9b3340277f29d63db3c64 100644 (file)
@@ -2351,6 +2351,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
   if ((sym->attr.if_source == IFSRC_UNKNOWN
        || sym->attr.if_source == IFSRC_IFBODY)
       && gsym->type != GSYM_UNKNOWN
+      && !gsym->binding_label
       && gsym->ns
       && gsym->ns->resolved != -1
       && gsym->ns->proc_name
@@ -10163,7 +10164,6 @@ gfc_verify_binding_labels (gfc_symbol *sym)
       gsym->where = sym->declared_at;
       gsym->sym_name = sym->name;
       gsym->binding_label = sym->binding_label;
-      gsym->binding_label = sym->binding_label;
       gsym->ns = sym->ns;
       gsym->mod_name = module;
       if (sym->attr.function)
index bf4b0f33714b14cdb4840cb93f05b1ffbd9c1465..c46c8df0d01001ac43cc1c458e22479c79aa2662 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-06  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59023
+       * gfortran.dg/bind_c_procs_2.f90: New.
+
 2014-01-05  John David Anglin  <danglin@gcc.gnu.org>
 
        * gcc.dg/tree-ssa/reassoc-33.c: Don't run on hppa*-*-*.
diff --git a/gcc/testsuite/gfortran.dg/bind_c_procs_2.f90 b/gcc/testsuite/gfortran.dg/bind_c_procs_2.f90
new file mode 100644 (file)
index 0000000..d3e751c
--- /dev/null
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 59023: [4.9 regression] ICE in gfc_search_interface with BIND(C)
+!
+! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+  type t
+    integer hidden
+  end type
+  
+contains
+
+  subroutine bar
+    type(t) :: toto
+    interface
+      integer function helper() bind(c)
+      end function
+    end interface
+    toto = t(helper())
+  end subroutine
+
+end