aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2018-06-26 05:44:26 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2018-06-26 05:44:26 +0000
commit27b1bf1ec4f6190dae78187a142353e52701570d (patch)
treeaca0f79cc7589e30339573600e8162724b4cd85f /gcc/dwarf2out.c
parentd54ca450d2dd008171d93c8051c1f83de8469900 (diff)
downloadgcc-27b1bf1ec4f6190dae78187a142353e52701570d.zip
gcc-27b1bf1ec4f6190dae78187a142353e52701570d.tar.gz
gcc-27b1bf1ec4f6190dae78187a142353e52701570d.tar.bz2
[PR86064] split single cross-partition range with nonzero locviews
We didn't split cross-partition ranges in loclists to output a whole-function location expression, but with nonzero locviews, we force loclists, and then we have to split to avoid cross-partition list entries. for gcc/ChangeLog PR debug/86064 * dwarf2out.c (loc_list_has_views): Adjust comments. (dw_loc_list): Split single cross-partition range with nonzero locview. for gcc/testsuite/ChangeLog PR debug/86064 * gcc.dg/pr86064.c: New. From-SVN: r262130
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8032364..b5e3134 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10029,7 +10029,15 @@ new_loc_list (dw_loc_descr_ref expr, const char *begin, var_loc_view vbegin,
return retlist;
}
-/* Return true iff there's any nonzero view number in the loc list. */
+/* Return true iff there's any nonzero view number in the loc list.
+
+ ??? When views are not enabled, we'll often extend a single range
+ to the entire function, so that we emit a single location
+ expression rather than a location list. With views, even with a
+ single range, we'll output a list if start or end have a nonzero
+ view. If we change this, we may want to stop splitting a single
+ range in dw_loc_list just because of a nonzero view, even if it
+ straddles across hot/cold partitions. */
static bool
loc_list_has_views (dw_loc_list_ref list)
@@ -17139,7 +17147,13 @@ dw_loc_list (var_loc_list *loc_list, tree decl, int want_address)
of first partition and second one starting at the
beginning of second partition. */
if (node == loc_list->last_before_switch
- && (node != loc_list->first || loc_list->first->next)
+ && (node != loc_list->first || loc_list->first->next
+ /* If we are to emit a view number, we will emit
+ a loclist rather than a single location
+ expression for the entire function (see
+ loc_list_has_views), so we have to split the
+ range that straddles across partitions. */
+ || !ZERO_VIEW_P (node->view))
&& current_function_decl)
{
endname = cfun->fde->dw_fde_end;