re PR fortran/36322 (ICE with PROCEDURE using a complicated interface)
authorJanus Weil <janus@gcc.gnu.org>
Wed, 4 Jun 2008 21:04:32 +0000 (23:04 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Wed, 4 Jun 2008 21:04:32 +0000 (23:04 +0200)
2008-06-04  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36322
PR fortran/36275
* resolve.c (resolve_symbol): Correctly copy the interface for a
PROCEDURE declaration.

2008-06-04  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36322
PR fortran/36275
* gfortran.dg/proc_decl_2.f90: Extended.

From-SVN: r136372

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/proc_decl_2.f90

index fd0817becbd3af40be3714d0734658674826f25e..826b40972f9bb5e980d91f14a1058c6777afca2c 100644 (file)
@@ -1,3 +1,10 @@
+2008-06-04  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/36322
+       PR fortran/36275
+       * resolve.c (resolve_symbol): Correctly copy the interface for a
+       PROCEDURE declaration.
+
 2008-06-02  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/36361
index c9809351c9455272d19821f5b2b5d1536a4499bc..b5b76b6f7a04f83df0fef943fc3f83d63d234591 100644 (file)
@@ -7893,11 +7893,12 @@ resolve_symbol (gfc_symbol *sym)
       /* Get the attributes from the interface (now resolved).  */
       if (sym->ts.interface->attr.if_source || sym->ts.interface->attr.intrinsic)
        {
-         sym->ts.type = sym->ts.interface->ts.type;
-         sym->ts.kind = sym->ts.interface->ts.kind;
-         sym->attr.function = sym->ts.interface->attr.function;
-         sym->attr.subroutine = sym->ts.interface->attr.subroutine;
-         copy_formal_args (sym, sym->ts.interface);
+         gfc_symbol *ifc = sym->ts.interface;
+         sym->ts = ifc->ts;
+         sym->ts.interface = ifc;
+         sym->attr.function = ifc->attr.function;
+         sym->attr.subroutine = ifc->attr.subroutine;
+         copy_formal_args (sym, ifc);
        }
       else if (sym->ts.interface->name[0] != '\0')
        {
index a2f746c8198ef5981f99ea7b3fc6a4174a6a8ee6..14414d95901fdacea6d11e70f500fca77442474c 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-04  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/36322
+       PR fortran/36275
+       * gfortran.dg/proc_decl_2.f90: Extended.
+
 2008-06-04  Joseph Myers  <joseph@codesourcery.com>
             Maxim Kuvyrkov  <maxim@codesourcery.com>
 
index 6edc6bd42b37f5886410f96eef5c59a6452a832b..a16b4db5f019613af7306373793c6c12dd7b2471 100644 (file)
@@ -4,16 +4,27 @@
 
 module m
 
+  use ISO_C_BINDING
+
   abstract interface
     subroutine csub() bind(c)
     end subroutine csub
   end interface
 
+  integer, parameter :: ckind = C_FLOAT_COMPLEX
+  abstract interface
+    function stub() bind(C)
+      import ckind
+      complex(ckind) stub
+    end function
+  end interface
+
   procedure():: mp1
   procedure(real), private:: mp2
   procedure(mfun), public:: mp3
   procedure(csub), public, bind(c) :: c, d
   procedure(csub), public, bind(c, name="myB") :: b
+  procedure(stub), bind(C) :: e
 
 contains
 
@@ -32,6 +43,15 @@ contains
     procedure(a), optional :: b
   end subroutine bar
 
+  subroutine bar2(x)
+    abstract interface
+      character function abs_fun()
+      end function
+    end interface
+    procedure(abs_fun):: x
+  end subroutine
+
+
 end module