diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-09 06:43:47 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-09 06:43:47 +0000 |
commit | f9c61ef7079c56ea974db9c5f4bc61e2aabe5f6e (patch) | |
tree | 95afa643e40b04b8d3422e12829ab8707b957836 /gcc/cfgexpand.c | |
parent | 7c9d8928e2da9a3b9eba57c74de27a51d3449dc6 (diff) | |
download | gcc-f9c61ef7079c56ea974db9c5f4bc61e2aabe5f6e.tar.gz |
* rtl.def (DEBUG_IMPLICIT_PTR): New rtl code.
* rtl.h (DEBUG_IMPLICIT_PTR_DECL): Define.
* rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_IMPLICIT_PTR.
* print-rtl.c (print_rtx): Likewise.
* cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise.
* cfgexpand.c (expand_debug_expr): Generate DEBUG_IMPLICIT_PTR
for ADDR_EXPR with non-addressable object.
* dwarf2out.c (enum dw_val_class): Add dw_val_class_decl_ref.
(struct dw_val_struct): Add v.val_decl_ref.
(dwarf_stack_op_name, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_GNU_implicit_pointer.
(size_of_loc_descr): Likewise. Fix up DW_OP_call_ref size.
(get_ref_die_offset_label): New function.
(implicit_ptr_descriptor): New function.
(mem_loc_descriptor): Handle DEBUG_IMPLICIT_PTR.
(loc_descriptor): Likewise.
(gen_variable_die): Put even definitions into decl_die_table.
(resolve_addr_in_expr): Resolve still unresolved
DW_OP_GNU_implicit_pointer operands, if it can't be resolved
return false.
(dwarf2out_finish): Call output_location_lists after outputting
.debug_info and .debug_abbrev instead of before.
* dwarf2.h (DW_OP_GNU_implicit_pointer): New.
2010-09-09 Roland McGrath <roland@redhat.com>
* dwarf2out.c (DWARF_REF_SIZE): Define.
(size_of_loc_descr): Use it for DW_OP_call_ref.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164050 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 4ae541dd2bc..42372769049 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2911,7 +2911,32 @@ expand_debug_expr (tree exp) case ADDR_EXPR: op0 = expand_debug_expr (TREE_OPERAND (exp, 0)); if (!op0 || !MEM_P (op0)) - return NULL; + { + if ((TREE_CODE (TREE_OPERAND (exp, 0)) == VAR_DECL + || TREE_CODE (TREE_OPERAND (exp, 0)) == PARM_DECL + || TREE_CODE (TREE_OPERAND (exp, 0)) == RESULT_DECL) + && !TREE_ADDRESSABLE (TREE_OPERAND (exp, 0))) + return gen_rtx_DEBUG_IMPLICIT_PTR (mode, TREE_OPERAND (exp, 0)); + + if (handled_component_p (TREE_OPERAND (exp, 0))) + { + HOST_WIDE_INT bitoffset, bitsize, maxsize; + tree decl + = get_ref_base_and_extent (TREE_OPERAND (exp, 0), + &bitoffset, &bitsize, &maxsize); + if ((TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL + || TREE_CODE (decl) == RESULT_DECL) + && !TREE_ADDRESSABLE (decl) + && (bitoffset % BITS_PER_UNIT) == 0 + && bitsize > 0 + && bitsize == maxsize) + return plus_constant (gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl), + bitoffset / BITS_PER_UNIT); + } + + return NULL; + } op0 = convert_debug_memory_address (mode, XEXP (op0, 0)); |