Re: [RFC] fortran: restore array indexing for all descriptor arrays [PR102043]

2022-07-02 Thread Thomas Koenig via Fortran



Hi Mikael,


Feel free to comment, do we need this?


Thanks for taking this on.

One thought: If we have to bite the bullet and break the ABI, why not go
all the way and use the C descriptors in ISO_Fortran_binding.h as
gfortran's native format?

Best regards

Thomas


Re: [RFC] fortran: restore array indexing for all descriptor arrays [PR102043]

2022-07-02 Thread Mikael Morin
Le 02/07/2022 à 13:18, Thomas Koenig a écrit :
> 
> One thought: If we have to bite the bullet and break the ABI, why not go
> all the way and use the C descriptors in ISO_Fortran_binding.h as
> gfortran's native format?
> 
As far as I know, CFI descriptors are mutually exclusive with
non-negative array indexes.

CFI descriptors' base_addr field points to the first element in
descriptor indexing order, so they can be indexed negatively and we
can’t safely use array indexing with them.

With an additional offset field it would be possible though (with a
different semantics for the base_addr field).  Or we just keep the
different semantics of the base_addr field and assume that there is an
implicit offset with value sum(extent * max(-sm, 0)).

Anyway, this is the long-delayed array descriptor reform, right?  Any
one remembers how far we are from it?