https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84620

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Author: aoliva
Date: Sat Mar 10 06:42:40 2018
New Revision: 258411

URL: https://gcc.gnu.org/viewcvs?rev=258411&root=gcc&view=rev
Log:
[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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/dwarf2out.h

Reply via email to