From ceccaacf4f6bb19faa219ceeefde81e582267a1e Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sun, 20 Feb 2011 23:16:47 +0100 Subject: re PR fortran/47797 (Debug: Odd first break point for subroutine breakp w/ allocatables) 2011-02-20 Tobias Burnus PR fortran/47797 * trans-decl.c (gfc_trans_deferred_vars): Use gfc_set_backend_locus and gfc_restore_backend_locus to have better debug locations. * trans-array.c (gfc_trans_deferred_array): Ditto. From-SVN: r170347 --- gcc/fortran/trans-array.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/trans-array.c') diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 83f0189..4e901f2 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -7156,6 +7156,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) "allocatable attribute or derived type without allocatable " "components."); + gfc_save_backend_locus (&loc); + gfc_set_backend_locus (&sym->declared_at); gfc_init_block (&init); gcc_assert (TREE_CODE (sym->backend_decl) == VAR_DECL @@ -7172,11 +7174,10 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) if (sym->attr.dummy || sym->attr.use_assoc || sym->attr.result) { gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE); + gfc_restore_backend_locus (&loc); return; } - gfc_save_backend_locus (&loc); - gfc_set_backend_locus (&sym->declared_at); descriptor = sym->backend_decl; /* Although static, derived types with default initializers and @@ -7225,8 +7226,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save) gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node); - gfc_init_block (&cleanup); gfc_restore_backend_locus (&loc); + gfc_init_block (&cleanup); /* Allocatable arrays need to be freed when they go out of scope. The allocatable components of pointers must not be touched. */ -- cgit v1.1