From 5dba0fb8453e71c6f03f7a00b41016fc327f89f9 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Thu, 21 Dec 2006 13:59:57 +0000 Subject: [PATCH] re PR fortran/30202 ([4.1 only] ICE in trans-array.c) 2006-12-21 Paul Thomas PR fortran/30202 * trans-array.c (gfc_conv_function_call): Use parmse.expr for the nullifying of intent(out) arguments rather than the backend declaration. 2006-12-21 Paul Thomas PR fortran/30202 * gfortran.dg/alloc_comp_basics_3.f90: New test. From-SVN: r120109 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-expr.c | 4 +--- gcc/testsuite/ChangeLog | 5 +++++ .../gfortran.dg/alloc_comp_basics_3.f90 | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dbc724a43213..c0dd40a16e38 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2006-12-21 Paul Thomas + + PR fortran/30202 + * trans-array.c (gfc_conv_function_call): Use parmse.expr for + the nullifying of intent(out) arguments rather than the backend + declaration. + 2006-12-20 Tobias Schlüter PR fortran/25392 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index bd7983487c44..6d46cd42263f 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2068,9 +2068,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, if (fsym && fsym->attr.allocatable && fsym->attr.intent == INTENT_OUT) { - tmp = e->symtree->n.sym->backend_decl; - if (e->symtree->n.sym->attr.dummy) - tmp = build_fold_indirect_ref (tmp); + tmp = build_fold_indirect_ref (parmse.expr); tmp = gfc_trans_dealloc_allocated (tmp); gfc_add_expr_to_block (&se->pre, tmp); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c5739dea6cbb..fb6666e68d09 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-12-21 Paul Thomas + + PR fortran/30202 + * gfortran.dg/alloc_comp_basics_3.f90: New test. + 2006-12-21 Jakub Jelinek PR middle-end/30262 diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90 new file mode 100644 index 000000000000..9140cd2ac490 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } +! Test the patch for PR30202 in which the INTENT(OUT) +! caused an ICE. +! +! Contributed by Salvatore Filippone +! +program class_scal_p + implicit none + type scal_p + real, allocatable :: b(:) + end type scal_p + type(scal_p) :: pd + call psb_geallv(pd%b) +contains + subroutine psb_geallv(x) + real, allocatable, intent(out) :: x(:) + end subroutine psb_geallv +end program class_scal_p -- 2.47.3