This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
dwarf2 thinko
- To: gcc-patches at gcc dot gnu dot org
- Subject: dwarf2 thinko
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 5 Jan 2001 17:02:43 -0800
- Cc: Michael Snyder <msnyder at redhat dot com>
2000-10-31 Richard Henderson <rth@redhat.com>
* dwarf2out.c (struct dw_loc_descr_struct): Add dw_loc_addr.
(size_of_locs): Set it.
(output_loc_operands): Use it to compute branch displacement.
(int_loc_descriptor): New.
(mem_loc_descriptor): Dereference memory in the proper size.
Use DW_OP_plus_uconst when possible. Use int_loc_descriptor.
(loc_descriptor_from_tree): New.
(rtl_for_decl_location): Break out from ...
(add_location_or_const_value_attribute): ... here.
(add_bound_info): Use loc_descriptor_from_tree.
In this patch I have a (somewhat large) thinko, in that I was looking
at the wrong mode when dereferencing memory in the "proper size".
Naturally an address is always Pmode.
This caused problems with targets that pass structs by invisible
reference, and then (because of -O0 or whatever) drop the address
onto the local stack.
r~
* dwarf2out.c (mem_loc_descriptor) [case MEM]: Revert 10-31 change.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.229
diff -c -p -d -r1.229 dwarf2out.c
*** dwarf2out.c 2001/01/02 19:29:12 1.229
--- dwarf2out.c 2001/01/06 00:48:50
*************** mem_loc_descriptor (rtl, mode)
*** 7649,7666 ****
break;
case MEM:
! {
! dw_loc_descr_ref deref;
!
! mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl));
!
! if (GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE)
! deref = new_loc_descr (DW_OP_deref, 0, 0);
! else
! deref = new_loc_descr (DW_OP_deref_size, GET_MODE_SIZE (mode), 0);
!
! add_loc_descr (&mem_loc_result, deref);
! }
break;
case LABEL_REF:
--- 7649,7656 ----
break;
case MEM:
! mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl));
! add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_deref, 0, 0));
break;
case LABEL_REF: