diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-02-20 23:16:47 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-02-20 23:16:47 +0100 |
commit | ceccaacf4f6bb19faa219ceeefde81e582267a1e (patch) | |
tree | 7a6a702da3ebbd57fd915eaf22e315933c23401e /gcc/fortran/trans-array.c | |
parent | a3a33a7b29aa6a4917cb8b4df9c2235d0f1354a9 (diff) | |
download | gcc-ceccaacf4f6bb19faa219ceeefde81e582267a1e.zip gcc-ceccaacf4f6bb19faa219ceeefde81e582267a1e.tar.gz gcc-ceccaacf4f6bb19faa219ceeefde81e582267a1e.tar.bz2 |
re PR fortran/47797 (Debug: Odd first break point for subroutine breakp w/ allocatables)
2011-02-20 Tobias Burnus <burnus@net-b.de>
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
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 7 |
1 files changed, 4 insertions, 3 deletions
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. */ |