This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libfortran] Use flexible array members for array descriptor
On Mon, Feb 12, 2018 at 08:41:56PM +0100, Thomas Koenig wrote:
> Am 08.02.2018 um 12:27 schrieb Richard Biener:
> > If the effect of the patch is (it doesn't include generated files) that the
> > function arguments now have pointers to array descriptor types with
> > the flexible array then yes, that's what will be needed anyways, no need
> > for any dust to settle here.
>
> All right.
>
> I have attached the patch updated with Janne's comments.
>
> Regression-tested. OK for trunk then?
For the library part, you could have just used a single
GFC_ARRAY_DESCRIPTOR macro, just use
GFC_ARRAY_DESCRIPTOR (, GFC_INTEGER_1) etc. when you want the flexible
array member.
The compiler side will be harder, wonder if we want to always use
as the TREE_TYPE of things what we use right now and have somewhere
in the lang_specific part a pointer to a type with flexible array member
and whenever trying to dereference something build a MEM_REF with the
flexible array member type; plus whenever passing it to some other function.
Or if we have some easy way to find out what objects will need local
variables with descriptors (those need the non-flexible array member stuff)
and others (e.g. dummy arguments etc.) where we could use just the flexible
array members.
Jakub