From 5b0b72518b76d75ad93ac95e6e05e772124085df Mon Sep 17 00:00:00 2001 From: Erik Edelmann Date: Sun, 12 Feb 2006 17:34:15 +0000 Subject: re PR fortran/25806 (problems with functions returning array pointers?) fortran/ 2006-02-12 Erik Edelmann PR fortran/25806 * trans-array.c (gfc_trans_allocate_array_storage): New argument dealloc; free the temporary only if dealloc is true. (gfc_trans_allocate_temp_array): New argument bool dealloc, to be passed onwards to gfc_trans_allocate_array_storage. (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to gfc_trans_allocate_temp_array. * trans-array.h (gfc_trans_allocate_temp_array): Update function prototype. * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc' to gfc_trans_allocate_temp_array to false in case of functions returning pointers. (gfc_trans_arrayfunc_assign): Return NULL for functions returning pointers. testsuite/ 2006-02-12 Erik Edelmann PR fortran/25806 * gfortran.dg/ret_pointer_2.f90: New test. From-SVN: r110893 --- gcc/fortran/trans-array.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/trans-array.h') diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h index ef3d0265187..2f9fd2d74ff 100644 --- a/gcc/fortran/trans-array.h +++ b/gcc/fortran/trans-array.h @@ -32,7 +32,8 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *, /* Generate code to allocate a temporary array. */ tree gfc_trans_allocate_temp_array (stmtblock_t *, stmtblock_t *, - gfc_loopinfo *, gfc_ss_info *, tree, bool); + gfc_loopinfo *, gfc_ss_info *, tree, bool, + bool); /* Generate function entry code for allocation of compiler allocated array variables. */ -- cgit v1.2.1