From 62ab4a54994341ab463149da427a51d70d2fbc70 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 9 Sep 2005 06:22:28 +0000 Subject: re PR fortran/21104 (Segmentation fault on correct code) PR fortran/21104 * trans.h (gfc_interface_sym_mapping, gfc_interface_mapping): Moved from trans-expr.c. (gfc_init_interface_mapping, gfc_free_interface_mapping) (gfc_add_interface_mapping, gfc_finish_interface_mapping) (gfc_apply_interface_mapping): Declare. * trans-array.h (gfc_set_loop_bounds_from_array_spec): Declare. (gfc_trans_allocate_temp_array): Add pre and post block arguments. * trans-array.c (gfc_set_loop_bounds_from_array_spec): New function. (gfc_trans_allocate_array_storage): Replace loop argument with separate pre and post blocks. (gfc_trans_allocate_temp_array): Add pre and post block arguments. Update call to gfc_trans_allocate_array_storage. (gfc_trans_array_constructor, gfc_conv_loop_setup): Adjust for new interface to gfc_trans_allocate_temp_array. * trans-expr.c (gfc_interface_sym_mapping, gfc_interface_mapping): Moved to trans.h. (gfc_init_interface_mapping, gfc_free_interface_mapping) (gfc_add_interface_mapping, gfc_finish_interface_mapping) (gfc_apply_interface_mapping): Make extern. (gfc_conv_function_call): Build an interface mapping for array return values too. Call gfc_set_loop_bounds_from_array_spec. Adjust call to gfc_trans_allocate_temp_array so that code is added to SE rather than LOOP. From-SVN: r104075 --- gcc/fortran/trans-array.h | 7 ++++++- 1 file changed, 6 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 eda4245d5d9..af990a9061c 100644 --- a/gcc/fortran/trans-array.h +++ b/gcc/fortran/trans-array.h @@ -26,8 +26,13 @@ tree gfc_array_deallocate (tree, tree); se, which should contain an expression for the array descriptor. */ void gfc_array_allocate (gfc_se *, gfc_ref *, tree); +/* Allow the bounds of a loop to be set from a callee's array spec. */ +void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *, + gfc_se *, gfc_array_spec *); + /* Generate code to allocate a temporary array. */ -tree gfc_trans_allocate_temp_array (gfc_loopinfo *, gfc_ss_info *, tree, bool); +tree gfc_trans_allocate_temp_array (stmtblock_t *, stmtblock_t *, + gfc_loopinfo *, gfc_ss_info *, tree, bool); /* Generate function entry code for allocation of compiler allocated array variables. */ -- cgit v1.2.1