This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [VTA, PR41473] drop NULL locations from lists
On Mon, Nov 23, 2009 at 03:40:16PM -0500, Jakub Jelinek wrote:
> On Mon, Nov 23, 2009 at 06:11:57PM -0200, Alexandre Oliva wrote:
> > Entries in location lists whose RTL is NULL or not representable end up
> > causing us to waste debug info space emitting empty DW_AT_location.
> >
> > This patch optimizes the debug information, omitting the useless
> > DW_AT_location. This should work around the bug in Darwin's dsymutil.
> >
> > While at that, I arranged for entries in location lists that are not
> > representable in debug info to not waste an entry in the output location
> > list.
> >
> > The patch also fixes the handling of CONST_DOUBLEs and CONST_VECTORs
> > within CONCAT and CONCATN, that was currently disabled because mode was
> > specified as VOIDmode by the handlers of these RTL forms. Even with
> > -gdwarf-4, we'd still have failed to emit them.
> >
> > Ok to install if this passes regstrap?
> >
>
> Are you sure the dropping of single_element_loc_list call in the
> loc->first && loc->last == loc->first case is a good idea?
> I believe that will force using location lists even when block form could be
> used for DW_AT_location. If loc->first->descr is NULL, the function should
> just return NULL, otherwise it should create the special single element list
> so that add_AT_location_description does the right thing.
>
> Jakub
Jakub,
I have tested this but on the gdb mailing list it was suggested that
in resolve_addr() we change...
a->dw_attr_val.v.val_loc = NULL;
to
a->dw_attr_val.v.val_loc = DW_OP_nop;
http://sourceware.org/ml/gdb/2009-11/msg00176.html
I haven't had a chance to test this patch on darwin yet...
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 154462)
+++ gcc/dwarf2out.c (working copy)
@@ -20991,7 +20991,7 @@
break;
case dw_val_class_loc:
if (!resolve_addr_in_expr (AT_loc (a)))
- a->dw_attr_val.v.val_loc = NULL;
+ a->dw_attr_val.v.val_loc = DW_OP_nop;
break;
case dw_val_class_addr:
if (a->dw_attr == DW_AT_const_value
@@ -20999,7 +20999,7 @@
{
a->dw_attr = DW_AT_location;
a->dw_attr_val.val_class = dw_val_class_loc;
- a->dw_attr_val.v.val_loc = NULL;
+ a->dw_attr_val.v.val_loc = DW_OP_nop;
}
break;
default:
to verify that dsymutil tolerates the DW_OP_nop. However, if it works,
might that be a more workable solution?
Jack