From: Janus Weil Date: Wed, 17 Dec 2014 21:12:42 +0000 (+0100) Subject: re PR fortran/64173 ([F03] ICE involving procedure pointer component) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4e2df89707db4e673927962ca3a6fddf305b764;p=gcc.git re PR fortran/64173 ([F03] ICE involving procedure pointer component) 2014-12-17 Janus Weil PR fortran/64173 * trans-array.c (structure_alloc_comps): Do not nullify procedure pointer components. 2014-12-17 Janus Weil PR fortran/64173 * gfortran.dg/proc_ptr_comp_40.f90: New. From-SVN: r218834 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index edbe42afecd..067b1334ce6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-12-17 Janus Weil + + PR fortran/64173 + * trans-array.c (structure_alloc_comps): Do not nullify procedure + pointer components. + 2014-12-17 Pierre-Marie de Rodat * trans-types.c (gfc_get_array_descr_info): Describe all Fortran arrays diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index e061dcf766a..67beab291a1 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24c5143c64d..2d885524325 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-17 Janus Weil + + PR fortran/64173 + * gfortran.dg/proc_ptr_comp_40.f90: New. + 2014-12-17 H.J. Lu 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 index 00000000000..07d09596598 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_40.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! +! PR 64173: [F03] ICE involving procedure pointer component +! +! Contributed by Rich Townsend + + 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