diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-04-16 17:34:47 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-04-16 17:34:47 +0200 |
commit | 835eb810f7438cc0979444a44583f2fd2db8ce4d (patch) | |
tree | 26a80bc0dca583583b55827d2866fc920e0edb4e /gcc | |
parent | db624ecb93ff1f8c8953fd1caadf64b1f1d71122 (diff) | |
download | gcc-835eb810f7438cc0979444a44583f2fd2db8ce4d.zip gcc-835eb810f7438cc0979444a44583f2fd2db8ce4d.tar.gz gcc-835eb810f7438cc0979444a44583f2fd2db8ce4d.tar.bz2 |
re PR debug/43762 (VLA artificial length var loclist is missing DW_OP_stack_value)
PR debug/43762
* dwarf2out.c (add_bound_info): Always call loc_list_from_tree
with want_address 2 and in case a single element list might be
possible, call it again with want_address 0.
From-SVN: r158430
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 25 |
2 files changed, 23 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a33b1f..3060efd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ -2010-04-12 Kaushik Phatak<kaushik.phatak@kpitcummins.com> +2010-04-16 Jakub Jelinek <jakub@redhat.com> + + PR debug/43762 + * dwarf2out.c (add_bound_info): Always call loc_list_from_tree + with want_address 2 and in case a single element list might be + possible, call it again with want_address 0. + +2010-04-12 Kaushik Phatak <kaushik.phatak@kpitcummins.com> * config/h8300/predicate.md (bit_operand): Allow immediate values that satisfy 'U' constraint. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2ca448e..5a9a3b8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16355,8 +16355,6 @@ lower_bound_default (void) static void add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree bound) { - int want_address = 2; - switch (TREE_CODE (bound)) { case ERROR_MARK: @@ -16419,7 +16417,6 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b add_AT_die_ref (subrange_die, bound_attr, decl_die); break; } - want_address = 0; } /* FALLTHRU */ @@ -16431,15 +16428,23 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b dw_die_ref ctx, decl_die; dw_loc_list_ref list; - list = loc_list_from_tree (bound, want_address); - if (list == NULL) - break; - - if (single_element_loc_list_p (list)) + list = loc_list_from_tree (bound, 2); + if (list == NULL || single_element_loc_list_p (list)) { - add_AT_loc (subrange_die, bound_attr, list->expr); - break; + /* If DW_AT_*bound is not a reference nor constant, it is + a DWARF expression rather than location description. + For that loc_list_from_tree (bound, 0) is needed. + If that fails to give a single element list, + fall back to outputting this as a reference anyway. */ + dw_loc_list_ref list2 = loc_list_from_tree (bound, 0); + if (list2 && single_element_loc_list_p (list2)) + { + add_AT_loc (subrange_die, bound_attr, list2->expr); + break; + } } + if (list == NULL) + break; if (current_function_decl == 0) ctx = comp_unit_die; |