re PR fortran/64173 ([F03] ICE involving procedure pointer component)
authorJanus Weil <janus@gcc.gnu.org>
Wed, 17 Dec 2014 21:12:42 +0000 (22:12 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Wed, 17 Dec 2014 21:12:42 +0000 (22:12 +0100)
2014-12-17  Janus Weil  <janus@gcc.gnu.org>

PR fortran/64173
* trans-array.c (structure_alloc_comps): Do not nullify procedure
pointer components.

2014-12-17  Janus Weil  <janus@gcc.gnu.org>

PR fortran/64173
* gfortran.dg/proc_ptr_comp_40.f90: New.

From-SVN: r218834

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/proc_ptr_comp_40.f90 [new file with mode: 0644]

index edbe42afecd8dd34ff9a13543e59b88d9cdc3936..067b1334ce64b9f4992dc91e9f1eccd77b7a719e 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-17  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/64173
+       * trans-array.c (structure_alloc_comps): Do not nullify procedure
+       pointer components.
+
 2014-12-17  Pierre-Marie de Rodat  <derodat@adacore.com>
 
        * trans-types.c (gfc_get_array_descr_info): Describe all Fortran arrays
index e061dcf766a3cd22fe082ee93e070a6d065578ee..67beab291a11216d0f8a2fc9e45a84de8d336f4f 100644 (file)
@@ -7774,7 +7774,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
          break;
 
        case NULLIFY_ALLOC_COMP:
-         if (c->attr.pointer)
+         if (c->attr.pointer || c->attr.proc_pointer)
            continue;
          else if (c->attr.allocatable
                   && (c->attr.dimension|| c->attr.codimension))
index 24c5143c64d3041e592fd35fc1cf263806db7a90..2d8855243256c1b043f2c9f6280c55e8127c3053 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-17  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/64173
+       * gfortran.dg/proc_ptr_comp_40.f90: New.
+
 2014-12-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/61296
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_40.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_40.f90
new file mode 100644 (file)
index 0000000..07d0959
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR 64173: [F03] ICE involving procedure pointer component
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+  implicit none
+
+  type :: r_magnus_ivp_t
+     integer, allocatable :: jc
+     procedure(abscissa_), nopass, pointer :: abscissa_p
+  end type
+
+  abstract interface
+     function abscissa_ () result (x)
+       real, allocatable :: x(:)
+     end function
+  end interface
+
+contains
+
+ function doinit () result (iv)
+   type(r_magnus_ivp_t) :: iv
+ end function
+
+end