From f3a5a02f6382f33cf2539aefbb71725bad6742df Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 31 Oct 2016 20:08:44 +0000 Subject: [PATCH] re PR debug/77315 (emit DW_OP_form_tls_address) PR debug/77315: * dwarf2out.c (mem_loc_descriptor): Use DW_OP_form_tls_address. (resolve_args_picking_1): Move DW_OP_form_tls_address case next to DW_OP_GNU_push_tls_address case. (loc_list_from_tree_1): Use DW_OP_form_tls_address. From-SVN: r241721 --- gcc/ChangeLog | 8 ++++++++ gcc/dwarf2out.c | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8725d0807b..4e354d01847 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-10-31 Tom Tromey + + PR debug/77315: + * dwarf2out.c (mem_loc_descriptor): Use DW_OP_form_tls_address. + (resolve_args_picking_1): Move DW_OP_form_tls_address case next to + DW_OP_GNU_push_tls_address case. + (loc_list_from_tree_1): Use DW_OP_form_tls_address. + 2016-10-31 Jakub Jelinek * dwarf2out.h (struct dw_loc_descr_node): Adjust comment diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bd16d0e71b4..a690b90a205 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -14251,7 +14251,12 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, temp = new_addr_loc_descr (rtl, dtprel_true); - mem_loc_result = new_loc_descr (DW_OP_GNU_push_tls_address, 0, 0); + /* We check for DWARF 5 here because gdb did not implement + DW_OP_form_tls_address until after 7.12. */ + mem_loc_result = new_loc_descr ((dwarf_version >= 5 + ? DW_OP_form_tls_address + : DW_OP_GNU_push_tls_address), + 0, 0); add_loc_descr (&mem_loc_result, temp); break; @@ -16137,7 +16142,6 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_piece: case DW_OP_deref_size: case DW_OP_nop: - case DW_OP_form_tls_address: case DW_OP_bit_piece: case DW_OP_implicit_value: case DW_OP_stack_value: @@ -16272,6 +16276,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_deref_type: case DW_OP_convert: case DW_OP_reinterpret: + case DW_OP_form_tls_address: case DW_OP_GNU_push_tls_address: case DW_OP_GNU_uninit: case DW_OP_GNU_encoded_addr: @@ -16615,8 +16620,11 @@ loc_list_from_tree_1 (tree loc, int want_address, operand shouldn't be. */ if (DECL_EXTERNAL (loc) && !targetm.binds_local_p (loc)) return 0; - dtprel = dtprel_true; - tls_op = DW_OP_GNU_push_tls_address; + dtprel = dtprel_true; + /* We check for DWARF 5 here because gdb did not implement + DW_OP_form_tls_address until after 7.12. */ + tls_op = (dwarf_version >= 5 ? DW_OP_form_tls_address + : DW_OP_GNU_push_tls_address); } else { -- 2.30.2