[Patch, Fortran] PR 59023: [4.9 regression] ICE in gfc_search_interface with BIND(C)

Janus Weil janus@gcc.gnu.org
Tue Dec 31 10:14:00 GMT 2013


Hi all,

... and the reg-bashing continues: Here is a small patch to fix a
bind(c) problem. It essentially prevents 'resolve_global_procedure' to
be applied to bind(c) procedures.

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus



2013-12-31  Janus Weil  <janus@gcc.gnu.org>

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

2013-12-31  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/59023
    * gfortran.dg/bind_c_procs_2.f90: New.
-------------- next part --------------
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 206252)
+++ gcc/fortran/resolve.c	(working copy)
@@ -2351,6 +2351,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *
   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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind_c_procs_2.f90
Type: text/x-fortran
Size: 385 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20131231/ce1503b9/attachment.bin>


More information about the Fortran mailing list