From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12181 invoked by alias); 26 Nov 2014 17:42:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12167 invoked by uid 89); 26 Nov 2014 17:42:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 26 Nov 2014 17:42:48 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAQHgjvN002587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 26 Nov 2014 12:42:45 -0500 Received: from tucnak.zalov.cz (ovpn-116-85.ams2.redhat.com [10.36.116.85]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAQHgh7H014953 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 26 Nov 2014 12:42:45 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id sAQHgfkY021530; Wed, 26 Nov 2014 18:42:41 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id sAQHgd9D020424; Wed, 26 Nov 2014 18:42:39 +0100 Date: Wed, 26 Nov 2014 18:07:00 -0000 From: Jakub Jelinek To: Pierre-Marie de Rodat Cc: GCC Patches Subject: Re: [PATCH] Enhance array types debug info. for Ada Message-ID: <20141126174239.GL1669@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <5406D305.1060905@adacore.com> <20141003091848.GN1986@tucnak.redhat.com> <54339F77.7050300@adacore.com> <20141007082926.GF1986@tucnak.redhat.com> <54358AFA.5020201@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54358AFA.5020201@adacore.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg03307.txt.bz2 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