This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Debug support for Fortran 90 assumed shape and other descriptor using arrays (PR fortran/22244)
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jakub Jelinek" <jakub at redhat dot com>
- Cc: "Tobias Burnus" <burnus at net-b dot de>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, jan dot kratochvil at redhat dot com
- Date: Sun, 9 Dec 2007 16:13:40 +0100
- Subject: Re: [PATCH] Debug support for Fortran 90 assumed shape and other descriptor using arrays (PR fortran/22244)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=bImiRrn0CIM72ZU/F4AOSfTCyf3dj1ZxV7+Jn2Muj/Q=; b=Jn2ZkjyEKsEIFGF3gnPfo1sbh9fI3XGpW8yDihTzw8vbnvnLn83srkXlq/x/dxYvYyTDa1V3Rbvh45NE9g6s4WgXpdXb2EeXiD6RiL1XUPeOU3u2ggdgRh/LzpSL1M8Kex73ueNrGGG2ACJA/QtFxzjc/RAJqDzEhvmsOo3dnyM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g+Cal+rC6ZjEtvu0JMuu/e4bun/ClVzyMoFG9XSw4FDpxDaGbW/ILV8XMy1JZi7d7cDoKfvOxF5zbxEUAM8oewQE8mQxpBQLnq7kVWTAsCjGQm25FnieA5aXtwU9e4rXd8qJJj2Dywy3pBMPhbzz1S1hk8LP5rKon9LlYtmh1vE=
- References: <20071112104603.GB5451@devserv.devel.redhat.com> <20071116080132.GU5451@devserv.devel.redhat.com> <473D82BE.7000601@net-b.de> <20071116121255.GW5451@devserv.devel.redhat.com> <473D95E2.9030302@net-b.de> <20071116132819.GY5451@devserv.devel.redhat.com>
On Nov 16, 2007 2:28 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Nov 16, 2007 at 02:06:42PM +0100, Tobias Burnus wrote:
> > Jakub Jelinek wrote:
> > > Can you look at with idb on gfortran (vanilla or patched) generated MAIN__
> > > x and y arrays after the bar subroutine returns and see if they are
> > > displayed in the expected order or not?
> > >
> > For the a5.f90 test case, compiled with ifort (!) I get:
>
> Ok, can you retry with the following additional patch on top of the previous
> one?
> It seems ifort emits DW_AT_subrange_type's in the same order as GCC, i.e.
> for (1:5, 4:7, 8:9) there is
> DW_AT_subrange_type
> DW_AT_lower_bound 1
> DW_AT_upper_bound 5
> DW_AT_subrange_type
> DW_AT_lower_bound 4
> DW_AT_upper_bound 7
> DW_AT_subrange_type
> DW_AT_lower_bound 8
> DW_AT_upper_bound 9
> but GCC doesn't add any DW_AT_ordering, while ifort adds
> DW_AT_ordering DW_ORD_col_major.
>
> Wonder what gdb will do in presence of DW_ORD_col_major, I fear that
> DW_ORD_col_major means it just reverses the order of DW_AT_subrange_type
> notes and has hardcoded another reordering for Fortran or something, Jan?
This is ok if properly tested.
Thanks,
Richard.
> --- gcc/dwarf2out.c.jj 2007-11-15 20:05:54.000000000 +0100
> +++ gcc/dwarf2out.c 2007-11-16 14:16:13.000000000 +0100
> @@ -11636,6 +11636,12 @@ gen_array_type_die (tree type, dw_die_re
> add_AT_flag (array_die, DW_AT_GNU_vector, 1);
> }
>
> + /* For Fortran multidimensional arrays use DW_ORD_col_major ordering. */
> + if (is_fortran ()
> + && TREE_CODE (type) == ARRAY_TYPE
> + && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
> + add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
> +
> #if 0
> /* We default the array ordering. SDB will probably do
> the right things even if DW_AT_ordering is not present. It's not even
> @@ -11787,6 +11793,11 @@ gen_descr_array_type_die (tree type, str
> add_name_attribute (array_die, type_tag (type));
> equate_type_number_to_die (type, array_die);
>
> + /* For Fortran multidimensional arrays use DW_ORD_col_major ordering. */
> + if (is_fortran ()
> + && info->ndimensions >= 2)
> + add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
> +
>
> if (info->data_location)
> add_descr_info_field (array_die, DW_AT_data_location, info->data_location,
> info->base_decl);
>
> Jakub
>