[LVU] reset view at function entry, omit views at line zero
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 8 Mar 2018 08:27:56 +0000 (08:27 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 8 Mar 2018 08:27:56 +0000 (08:27 +0000)
commitbc7b0ffa6335f22ae91101d5b072871ebbdc5013
treea829480cefdbd86c13e092a243152e08c035a61f
parentce8b1a1f132aff97d670bd326dd89ae318cd3c68
[LVU] reset view at function entry, omit views at line zero

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.

From-SVN: r258355
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr84404.c [new file with mode: 0644]