[LVU] reset view at function entry, omit views at line zero

Programming / Compilers / GCC - aoliva [138bc75d-0d04-0410-961f-82ee72b054a4] - 8 March 2018 08:27 EST

Location views might be associated with locations that lack line number information (line number zero), but since we omit .loc directives that would have been issued with line number zero, we also omit the symbolic view numbers that would have been issued at such points.

Resetting views at function entry points address some of these issues, and alleviate the huge chains of symbolic views that have burdened assemblers since we disabled -ginternal-reset-location-views by default, but other problems of undefined views remain when it's not the whole function that lacks line number info, just parts of it.

So, when we encounter a request to output a view that may have been referenced, but we decide to omit the .loc because the line is zero, we will now omit the view as well, i.e., we will internally regard that view as zero-numbered.

for gcc/ChangeLog

PR debug/84404 PR debug/84408
- dwarf2out.c (struct dw_line_info_table): Update comments for
view == -1. (FORCE_RESET_NEXT_VIEW): New. (FORCE_RESETTING_VIEW_P): New. (RESETTING_VIEW_P): Check for -1 too. (ZERO_VIEW_P): Likewise. (new_line_info_table): Force-reset next view. (dwarf2out_begin_function): Likewise. (dwarf2out_source_line): Simplify zero_view_p initialization. Test FORCE_RESETTING_VIEW_P and RESETTING_VIEW_P instead of
view directly. Omit view when omitting .loc at line 0.

for gcc/testsuite/ChangeLog

PR debug/84404 PR debug/84408
- gcc.dg/graphite/pr84404.c: New.

f8e02f3317e [LVU] reset view at function entry, omit views at line zero
gcc/ChangeLog | 16 ++++++
gcc/dwarf2out.c | 89 +++++++++++++++++++++++++--------
gcc/testsuite/ChangeLog | 6 +++
gcc/testsuite/gcc.dg/graphite/pr84404.c | 18 +++++++
4 files changed, 109 insertions(+), 20 deletions(-)

Upstream: gcc.gnu.org

  • Share