[IEPM] [PR debug/84620] use constant form for DW_AT_GNU_entry_view
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 10 Mar 2018 06:42:40 +0000 (06:42 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sat, 10 Mar 2018 06:42:40 +0000 (06:42 +0000)
commit7b602c4dc28c0eb24fec50fe20af78c13114e8a6
tree4de84df5e003b3f53849813f2f9e7085cf81b1fd
parent7ed12599fa74fdfd9bd36853b50a6086f89df061
[IEPM] [PR debug/84620] use constant form for DW_AT_GNU_entry_view

When outputting entry views in symbolic mode, we used to use a lbl_id,
but that outputs the view as an addr, perhaps even in an indirect one,
which is all excessive and undesirable for a small assembler-computed
constant.

Introduce a new value class for symbolic views, so that we can output
the labels as constant data, using as narrow forms as possible, but
wide enough for any symbolic views output in the compilation.  We
don't know exactly where the assembler will reset views, but we count
the symbolic views since known reset points and use that as an upper
bound for view numbers.

Ideally, we'd use uleb128, but then the compiler would have to defer
.debug_info offset computation to the assembler.  I'm not going there
for now, so a symbolic uleb128 assembler constant in an attribute is
not something GCC can deal with ATM.

for  gcc/ChangeLog

PR debug/84620
* dwarf2out.h (dw_val_class): Add dw_val_class_symview.
(dw_val_node): Add val_symbolic_view.
* dwarf2out.c (dw_line_info_table): Add symviews_since_reset.
(symview_upper_bound): New.
(new_line_info_table): Initialize symviews_since_reset.
(dwarf2out_source_line): Count symviews_since_reset and set
symview_upper_bound.
(dw_val_equal_p): Handle symview.
(add_AT_symview): New.
(print_dw_val): Handle symview.
(attr_checksum, attr_checksum_ordered): Likewise.
(same_dw_val_p, size_of_die): Likewise.
(value_format, output_die): Likewise.
(add_high_low_attributes): Use add_AT_symview for entry_view.
(dwarf2out_finish): Reset symview_upper_bound, clear
zero_view_p.

From-SVN: r258411
gcc/ChangeLog
gcc/dwarf2out.c
gcc/dwarf2out.h