This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix debug info for parameters passed by reference


On Fri, Sep 25, 2009 at 2:20 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151901
> changes broke probably most of fortran gdb testcases.
> loc_by_reference call has been removed, which means that decl_by_reference_p
> decls no longer add the needed DW_OP_deref.
>
> Fixed by the second hunk (would be the same as passing
> 1 for decl_by_reference_p and then calling loc_by_reference on the list
> entries, but I think just letting loc_list_from_tree do the references
> itself is better.
>
> The first hunk shouldn't make a real difference, as loc_list_from_tree
> doesn't care whether want_address is 1 or 2, but as we often append
> something to that list, using 2 is just wrong.
>
> Ok for trunk if it passes bootstrap/regtest?

I wonder if you can add a guality testcase for Fortran reference
passing ;)

Ok.

Thanks,
Richard.

> 2009-09-25 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?* dwarf2out.c (tls_mem_loc_descriptor): Pass 1 instead of 2
> ? ? ? ?to loc_descriptor_from_tree.
> ? ? ? ?(add_location_or_const_value_attribute): Pass 0 instead of 2
> ? ? ? ?for decl_by_reference_p decls.
>
> --- gcc/dwarf2out.c.jj ?2009-09-24 11:32:36.000000000 +0200
> +++ gcc/dwarf2out.c ? ? 2009-09-25 14:07:42.000000000 +0200
> @@ -11061,7 +11061,7 @@ tls_mem_loc_descriptor (rtx mem)
> ? ? ? || !DECL_THREAD_LOCAL_P (base))
> ? ? return NULL;
>
> - ?loc_result = loc_descriptor_from_tree (MEM_EXPR (mem), 2);
> + ?loc_result = loc_descriptor_from_tree (MEM_EXPR (mem), 1);
> ? if (loc_result == NULL)
> ? ? return NULL;
>
> @@ -13911,7 +13911,7 @@ add_location_or_const_value_attribute (d
> ? ? ? ? ?&& add_const_value_attribute (die, rtl))
> ? ? ? ? return true;
> ? ? }
> - ?list = loc_list_from_tree (decl, 2);
> + ?list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2);
> ? if (list)
> ? ? {
> ? ? ? add_AT_location_description (die, attr, list);
>
> ? ? ? ?Jakub
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]