[PATCH] Fix debuginfo for Fortran subref array pointers

Tobias Burnus burnus@net-b.de
Fri Aug 29 15:48:00 GMT 2008


Hi Jakub,

Jakub Jelinek wrote:
> This patch fixes debuginfo for Fortran subref array pointers (stride
> has to be multiplied by the content of its span variable instead of
> element size) and also fixes a couple of small issues (e.g.
> TREE_STATIC has been always set on the span variable, which is undesirable
> at least for OpenMP or recursive procedures).
The Fortran part of your patch is OK - hopefully, all 7 patches with 
pending Dwarf2out approval get reviewed/approved before stage3. Thanks 
for spotting and fixing this bug.

> That said, subref array pointers don't appear to work for dummy arguments (f951 ICEs if a
> dummy array pointer is later pointed to is_subref_array) and I don't see how
> it can possibly work with array pointers in modules, or in common blocks,
> or threadprivate.
>
> Is there a plan to do it right with the next major ABI change (i.e.
> represent strides in bytes rather than elements and kill this span stuff)?
> I think there are comments about intending to go from 7 to 15 maximum rank
> and that will need ABI changes to the array descriptors anyway.
>   

I think this is the planned for 4.5. There exists a draft TR (ISO 
Technical Report) for extended C interoperability, which defined (for 
interoperability) a struct to be used for the C side to use 
assumed-shape arrays. Our plan was to use this struct also internally 
for the Fortran side, which makes the interop implementation easier, 
saves us form coming up with something of our own + documenting it, and 
especially is something well-though about.

Tobias

> 2008-08-28  Jakub Jelinek  <jakub@redhat.com>
> 	* trans.h (struct lang_type): Add span.
> 	(GFC_TYPE_ARRAY_SPAN): Define.
> 	* trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
> 	copy TREE_STATIC from decl to span instead of setting it
> 	unconditionally, set DECL_ARTIFICIAL, fix type of initializer
> 	and set GFC_TYPE_ARRAY_SPAN on decl's type.
> 	* trans-types.c (gfc_get_array_descr_info): If
> 	GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
>   



More information about the Fortran mailing list