This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Enhance array types debug info. for Ada
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Pierre-Marie de Rodat <derodat at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Nov 2014 18:42:39 +0100
- Subject: Re: [PATCH] Enhance array types debug info. for Ada
- Authentication-results: sourceware.org; auth=none
- References: <5406D305 dot 1060905 at adacore dot com> <20141003091848 dot GN1986 at tucnak dot redhat dot com> <54339F77 dot 7050300 at adacore dot com> <20141007082926 dot GF1986 at tucnak dot redhat dot com> <54358AFA dot 5020201 at adacore dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Oct 08, 2014 at 09:05:30PM +0200, Pierre-Marie de Rodat wrote:
> gcc/
> * dwarf2out.h (struct array_descr_info): Remove the base_decl field.
> * dwarf2out.c (enum dw_scalar_form): New.
> (struct loc_descr_context): New.
> (add_scalar_info): New.
> (add_bound_info): Add a context parameter. Use add_scalar_info.
> (loc_list_from_tree): Add a context parameter. Handle PLACEHOLDER_EXPR
> nodes for type-related expressions. Likewise for base declarations.
> (loc_descriptor_from_tree): Add a context parameter.
> (subrange_type_die): Update calls to add_bound_info.
> (tls_mem_loc_descriptor): Likewise.
> (loc_list_for_address_of_addr_expr_of_indirect_ref): Add a context
> parameter. Update calls to loc_list_from_tree.
> (add_subscript_info): Update calls to add_bound_info.
> (gen_array_type_die): Update calls to loc_list_from_tree and to
> add_bound_info.
> (descr_info_loc): Remove.
> (add_descr_info_field): Remove.
> (gen_descr_array_type_die): Switch add_descr_info_field calls into
> add_scalar_info/add_bound_info ones.
> (gen_subprogram_die): Update calls to loc_list_from_tree.
> (gen_variable_die): Likewise.
Replace implicitely with implicitly in the whole patch.
> + to refer to register values).
> +
> + CONTEXT provides information to customize the location descriptions
> + generation. Its context_type field specifies what type is implicitely
> + referenced by DW_OP_push_object_address. If it is NULL_TREE, this operation
> + will not be generated.
> +
> + If CONTEXT is NULL, the behavior is the same as if the context_type field
> + was NULL_TREE. */
as if both context_type and base_decl were NULL_TREE?
> @@ -14311,6 +14351,12 @@ loc_list_from_tree (tree loc, int want_address)
> extending the values properly. Hopefully this won't be a real
> problem... */
>
> + if (context != NULL
> + && context->base_decl == loc
> + && want_address == 0)
> + return new_loc_list (new_loc_descr (DW_OP_push_object_address, 0, 0),
> + NULL, NULL, NULL);
> +
This isn't guarded with dwarf_version >= 3 || !dwarf_strict. Shouldn't it
be too and return NULL otherwise?
> + expansion_failed (loc, NULL_RTX,
> + "PLACEHOLDER_EXPR for a unexpected type");
for an unexpected type?
> @@ -14533,7 +14594,8 @@ loc_list_from_tree (tree loc, int want_address)
>
> list_ret = loc_list_from_tree (obj,
> want_address == 2
> - && !bitpos && !offset ? 2 : 1);
> + && !bitpos && !offset ? 2 : 1,
> + context);
Formatting. Should use tabs, not spaces.
> + if (prec <= HOST_BITS_PER_WIDE_INT
> + || tree_fits_uhwi_p (value))
Formatting. || should be below p in prec.
Would be nice if you tried more than one fortran testcase, say build
all gfortran.dg/ tests with -O0 -g -dA (and perhaps -O2 -g -dA afterwards)
with both unpatched and patched compilers and diff *.s files?
Otherwise, LGTM.
Jakub