public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, fortran] A first small step towards CFI descriptor implementation
@ 2018-07-31 12:07 Paul Richard Thomas
  2018-07-31 14:57 ` Richard Biener
  2018-07-31 17:10 ` Janus Weil
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Richard Thomas @ 2018-07-31 12:07 UTC (permalink / raw)
  To: fortran, gcc-patches; +Cc: Damian Rouson, celisdanieljr

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

Daniel Celis Garza and Damian Rouson have developed a runtime library
and include file for the TS 29113 and F2018 C descriptors.
https://github.com/sourceryinstitute/ISO_Fortran_binding

The ordering of types is different to the current 'bt' enum in
libgfortran.h. This patch interchanges BT_DERIVED and BT_CHARACTER to
fix this.

Regtests on FC28/x86_64. OK for trunk?

Cheers

Paul

2018-07-31  Paul Thomas  <pault@gcc.gnu.org>

    * gcc/fortran/libgfortran.h : In bt enum interchange BT_DERIVED
    and BT_CHARACTER for CFI descriptor compatibility(TS 29113).

[-- Attachment #2: submit1.diff --]
[-- Type: text/x-patch, Size: 733 bytes --]

Index: gcc/fortran/libgfortran.h
===================================================================
*** gcc/fortran/libgfortran.h	(revision 262444)
--- gcc/fortran/libgfortran.h	(working copy)
*************** typedef enum
*** 171,177 ****
     used in the run-time library for IO.  */
  typedef enum
  { BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX,
!   BT_DERIVED, BT_CHARACTER, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID,
    BT_ASSUMED, BT_UNION
  }
  bt;
--- 171,177 ----
     used in the run-time library for IO.  */
  typedef enum
  { BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX,
!   BT_CHARACTER, BT_DERIVED, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID,
    BT_ASSUMED, BT_UNION
  }
  bt;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch, fortran] A first small step towards CFI descriptor implementation
  2018-07-31 12:07 [Patch, fortran] A first small step towards CFI descriptor implementation Paul Richard Thomas
@ 2018-07-31 14:57 ` Richard Biener
  2018-07-31 15:13   ` Paul Richard Thomas
  2018-07-31 17:10 ` Janus Weil
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Biener @ 2018-07-31 14:57 UTC (permalink / raw)
  To: Paul Richard Thomas; +Cc: fortran, GCC Patches, damian, celisdanieljr

On Tue, Jul 31, 2018 at 2:07 PM Paul Richard Thomas
<paul.richard.thomas@gmail.com> wrote:
>
> Daniel Celis Garza and Damian Rouson have developed a runtime library
> and include file for the TS 29113 and F2018 C descriptors.
> https://github.com/sourceryinstitute/ISO_Fortran_binding
>
> The ordering of types is different to the current 'bt' enum in
> libgfortran.h. This patch interchanges BT_DERIVED and BT_CHARACTER to
> fix this.
>
> Regtests on FC28/x86_64. OK for trunk?

That's an ABI change, correct?

Richard.

> Cheers
>
> Paul
>
> 2018-07-31  Paul Thomas  <pault@gcc.gnu.org>
>
>     * gcc/fortran/libgfortran.h : In bt enum interchange BT_DERIVED
>     and BT_CHARACTER for CFI descriptor compatibility(TS 29113).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch, fortran] A first small step towards CFI descriptor implementation
  2018-07-31 14:57 ` Richard Biener
@ 2018-07-31 15:13   ` Paul Richard Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Richard Thomas @ 2018-07-31 15:13 UTC (permalink / raw)
  To: Richard Guenther; +Cc: fortran, gcc-patches, Damian Rouson, Daniel Celis Garza

Hi Richard,

Ah yes, you are absolutely right. I will sit on it for a bit and do
the interchange at the descriptor conversion stage for now.

Thanks

Paul
On Tue, 31 Jul 2018 at 15:57, Richard Biener <richard.guenther@gmail.com> wrote:
>
> On Tue, Jul 31, 2018 at 2:07 PM Paul Richard Thomas
> <paul.richard.thomas@gmail.com> wrote:
> >
> > Daniel Celis Garza and Damian Rouson have developed a runtime library
> > and include file for the TS 29113 and F2018 C descriptors.
> > https://github.com/sourceryinstitute/ISO_Fortran_binding
> >
> > The ordering of types is different to the current 'bt' enum in
> > libgfortran.h. This patch interchanges BT_DERIVED and BT_CHARACTER to
> > fix this.
> >
> > Regtests on FC28/x86_64. OK for trunk?
>
> That's an ABI change, correct?
>
> Richard.
>
> > Cheers
> >
> > Paul
> >
> > 2018-07-31  Paul Thomas  <pault@gcc.gnu.org>
> >
> >     * gcc/fortran/libgfortran.h : In bt enum interchange BT_DERIVED
> >     and BT_CHARACTER for CFI descriptor compatibility(TS 29113).



-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch, fortran] A first small step towards CFI descriptor implementation
  2018-07-31 12:07 [Patch, fortran] A first small step towards CFI descriptor implementation Paul Richard Thomas
  2018-07-31 14:57 ` Richard Biener
@ 2018-07-31 17:10 ` Janus Weil
  2018-08-02  9:04   ` Paul Richard Thomas
  1 sibling, 1 reply; 5+ messages in thread
From: Janus Weil @ 2018-07-31 17:10 UTC (permalink / raw)
  To: Paul Richard Thomas; +Cc: fortran, gcc-patches, Damian Rouson, celisdanieljr

Hi Paul,

2018-07-31 14:06 GMT+02:00 Paul Richard Thomas <paul.richard.thomas@gmail.com>:
> Daniel Celis Garza and Damian Rouson have developed a runtime library
> and include file for the TS 29113 and F2018 C descriptors.
> https://github.com/sourceryinstitute/ISO_Fortran_binding
>
> The ordering of types is different to the current 'bt' enum in
> libgfortran.h. This patch interchanges BT_DERIVED and BT_CHARACTER to
> fix this.

is this ordering actually fixed by the F18 standard, or is there any
other reason why it needs to be like this? What's wrong with
gfortran's current ordering?

Cheers,
Janus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch, fortran] A first small step towards CFI descriptor implementation
  2018-07-31 17:10 ` Janus Weil
@ 2018-08-02  9:04   ` Paul Richard Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Richard Thomas @ 2018-08-02  9:04 UTC (permalink / raw)
  To: Janus Weil; +Cc: fortran, gcc-patches, Damian Rouson, Daniel Celis Garza

The ordering is fixed by the ordering of types in the CFI part of the
standard. Intrinsic types, then derived types and finally all the
others.

For the time being I will interchange character and derived types in
the conversion functions.

Cheers

Paul
On Tue, 31 Jul 2018 at 18:10, Janus Weil <janus@gcc.gnu.org> wrote:
>
> Hi Paul,
>
> 2018-07-31 14:06 GMT+02:00 Paul Richard Thomas <paul.richard.thomas@gmail.com>:
> > Daniel Celis Garza and Damian Rouson have developed a runtime library
> > and include file for the TS 29113 and F2018 C descriptors.
> > https://github.com/sourceryinstitute/ISO_Fortran_binding
> >
> > The ordering of types is different to the current 'bt' enum in
> > libgfortran.h. This patch interchanges BT_DERIVED and BT_CHARACTER to
> > fix this.
>
> is this ordering actually fixed by the F18 standard, or is there any
> other reason why it needs to be like this? What's wrong with
> gfortran's current ordering?
>
> Cheers,
> Janus



-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-02  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 12:07 [Patch, fortran] A first small step towards CFI descriptor implementation Paul Richard Thomas
2018-07-31 14:57 ` Richard Biener
2018-07-31 15:13   ` Paul Richard Thomas
2018-07-31 17:10 ` Janus Weil
2018-08-02  9:04   ` Paul Richard Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).