public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* A doubt about IMPORT and SELECT TYPE
       [not found] <6b48bc0f-043f-4635-abaf-bac09d67323b.1685712510891@community.intel.com>
@ 2023-06-02 14:12 ` Jorge D'Elia
  2023-06-02 14:53   ` Paul Richard Thomas
  2023-06-02 15:19   ` Paul Richard Thomas
  0 siblings, 2 replies; 6+ messages in thread
From: Jorge D'Elia @ 2023-06-02 14:12 UTC (permalink / raw)
  To: Gfortran List

Hi,

I have a doubt about IMPORT and SELECT TYPE, please see the 
forwarded message below (that also has a sample code), as well 

https://www.ibm.com/docs/en/xffbg/121.141?topic=attributes-import-fortran-2003

What is the correct way? Thanks.

Regards.
Jorge.

----- Forwarded message -----
From: "Intel Community" 
To: "Jorge D'Elia" <jdelia@cimec.unl.edu.ar>
Sent: Viernes, 2 de Junio 2023 10:28:31
Subject: Re: Bug with IMPORT and SELECT TYPE (Intel Community Subscription Update)

Hi jdelia,

OP1 (New Contributor II) posted a new reply in Intel® Fortran Compiler on 06-02-2023 10:28 AM in the Intel Community:

https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-and-SELECT-TYPE/m-p/1492319/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufExJRUxQQzhSUEVaS1RTfDE0OTIzMTl8U1VCU0NSSVBUSU9OU3xoSw#M166583

Subject:  Re: Bug with IMPORT and SELECT TYPE

Well, it appears that gfortran also gets it wrong... the use of an IMPORT statement is not limited to interfaces. 
See this paragraph from the Intel documentation: An IMPORT statement can appear in a submodule, module procedure, 
a contained procedure, the specification part of a BLOCK construct, or in an interface body. It can not appear in 
the specification part of a main program, external procedure, module, or block data except in an interface body.

--

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

* Re: A doubt about IMPORT and SELECT TYPE
  2023-06-02 14:12 ` A doubt about IMPORT and SELECT TYPE Jorge D'Elia
@ 2023-06-02 14:53   ` Paul Richard Thomas
  2023-06-02 15:22     ` Steve Kargl
  2023-06-02 15:19   ` Paul Richard Thomas
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Richard Thomas @ 2023-06-02 14:53 UTC (permalink / raw)
  To: Jorge D'Elia; +Cc: Gfortran List, Jorge D'Elia

Hi Jorge,

As I posted in the Intel Community, the error generated by gfortran
(and nagfor) is consistent with the F2003 constraint: C1210 (R1209)
The IMPORT statement is allowed only in an interface-body.

Could you please raise a problem report in gcc Bugzilla?

Thanks

Paul

On Fri, 2 Jun 2023 at 15:04, Jorge D'Elia via Fortran
<fortran@gcc.gnu.org> wrote:
>
> Hi,
>
> I have a doubt about IMPORT and SELECT TYPE, please see the
> forwarded message below (that also has a sample code), as well
>
> https://www.ibm.com/docs/en/xffbg/121.141?topic=attributes-import-fortran-2003
>
> What is the correct way? Thanks.
>
> Regards.
> Jorge.
>
> ----- Forwarded message -----
> From: "Intel Community"
> To: "Jorge D'Elia" <jdelia@cimec.unl.edu.ar>
> Sent: Viernes, 2 de Junio 2023 10:28:31
> Subject: Re: Bug with IMPORT and SELECT TYPE (Intel Community Subscription Update)
>
> Hi jdelia,
>
> OP1 (New Contributor II) posted a new reply in Intel® Fortran Compiler on 06-02-2023 10:28 AM in the Intel Community:
>
> https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-and-SELECT-TYPE/m-p/1492319/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufExJRUxQQzhSUEVaS1RTfDE0OTIzMTl8U1VCU0NSSVBUSU9OU3xoSw#M166583
>
> Subject:  Re: Bug with IMPORT and SELECT TYPE
>
> Well, it appears that gfortran also gets it wrong... the use of an IMPORT statement is not limited to interfaces.
> See this paragraph from the Intel documentation: An IMPORT statement can appear in a submodule, module procedure,
> a contained procedure, the specification part of a BLOCK construct, or in an interface body. It can not appear in
> the specification part of a main program, external procedure, module, or block data except in an interface body.
>
> --



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

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

* Re: A doubt about IMPORT and SELECT TYPE
  2023-06-02 14:12 ` A doubt about IMPORT and SELECT TYPE Jorge D'Elia
  2023-06-02 14:53   ` Paul Richard Thomas
@ 2023-06-02 15:19   ` Paul Richard Thomas
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Richard Thomas @ 2023-06-02 15:19 UTC (permalink / raw)
  To: Jorge D'Elia; +Cc: Gfortran List, Jorge D'Elia

Hi Jorge,

PRs 108650/106035 cover this problem.

Thanks

Paul

On Fri, 2 Jun 2023 at 15:04, Jorge D'Elia via Fortran
<fortran@gcc.gnu.org> wrote:
>
> Hi,
>
> I have a doubt about IMPORT and SELECT TYPE, please see the
> forwarded message below (that also has a sample code), as well
>
> https://www.ibm.com/docs/en/xffbg/121.141?topic=attributes-import-fortran-2003
>
> What is the correct way? Thanks.
>
> Regards.
> Jorge.
>
> ----- Forwarded message -----
> From: "Intel Community"
> To: "Jorge D'Elia" <jdelia@cimec.unl.edu.ar>
> Sent: Viernes, 2 de Junio 2023 10:28:31
> Subject: Re: Bug with IMPORT and SELECT TYPE (Intel Community Subscription Update)
>
> Hi jdelia,
>
> OP1 (New Contributor II) posted a new reply in Intel® Fortran Compiler on 06-02-2023 10:28 AM in the Intel Community:
>
> https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-and-SELECT-TYPE/m-p/1492319/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufExJRUxQQzhSUEVaS1RTfDE0OTIzMTl8U1VCU0NSSVBUSU9OU3xoSw#M166583
>
> Subject:  Re: Bug with IMPORT and SELECT TYPE
>
> Well, it appears that gfortran also gets it wrong... the use of an IMPORT statement is not limited to interfaces.
> See this paragraph from the Intel documentation: An IMPORT statement can appear in a submodule, module procedure,
> a contained procedure, the specification part of a BLOCK construct, or in an interface body. It can not appear in
> the specification part of a main program, external procedure, module, or block data except in an interface body.
>
> --



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

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

* Re: A doubt about IMPORT and SELECT TYPE
  2023-06-02 14:53   ` Paul Richard Thomas
@ 2023-06-02 15:22     ` Steve Kargl
  2023-06-02 20:14       ` Paul Richard Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Kargl @ 2023-06-02 15:22 UTC (permalink / raw)
  To: Paul Richard Thomas via Fortran; +Cc: Jorge D'Elia, Jorge D'Elia

On Fri, Jun 02, 2023 at 03:53:44PM +0100, Paul Richard Thomas via Fortran wrote:
> Hi Jorge,
> 
> As I posted in the Intel Community, the error generated by gfortran
> (and nagfor) is consistent with the F2003 constraint: C1210 (R1209)
> The IMPORT statement is allowed only in an interface-body.
> 
> Could you please raise a problem report in gcc Bugzilla?
> 

There already is a PR about IMPORT.  See 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106035

There is a patch that is 95-ish% complete.  The last
5% is the hard part, which it seems no one has had
time or ideas on how to finish the patch.

-- 
Steve

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

* Re: A doubt about IMPORT and SELECT TYPE
  2023-06-02 15:22     ` Steve Kargl
@ 2023-06-02 20:14       ` Paul Richard Thomas
  2023-06-02 21:04         ` Steve Kargl
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Richard Thomas @ 2023-06-02 20:14 UTC (permalink / raw)
  To: Steve Kargl
  Cc: Paul Richard Thomas via Fortran, Jorge D'Elia, Jorge D'Elia

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

Hi Steve,

As noted in the previous email :-), although I didn't mention the partially
cooked patch.

One day, once F2003 is sorted, I might turn to F2008/18!

Cheers

Paul


On Fri, 2 Jun 2023, 16:27 Steve Kargl via Fortran, <fortran@gcc.gnu.org>
wrote:

> On Fri, Jun 02, 2023 at 03:53:44PM +0100, Paul Richard Thomas via Fortran
> wrote:
> > Hi Jorge,
> >
> > As I posted in the Intel Community, the error generated by gfortran
> > (and nagfor) is consistent with the F2003 constraint: C1210 (R1209)
> > The IMPORT statement is allowed only in an interface-body.
> >
> > Could you please raise a problem report in gcc Bugzilla?
> >
>
> There already is a PR about IMPORT.  See
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106035
>
> There is a patch that is 95-ish% complete.  The last
> 5% is the hard part, which it seems no one has had
> time or ideas on how to finish the patch.
>
> --
> Steve
>

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

* Re: A doubt about IMPORT and SELECT TYPE
  2023-06-02 20:14       ` Paul Richard Thomas
@ 2023-06-02 21:04         ` Steve Kargl
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Kargl @ 2023-06-02 21:04 UTC (permalink / raw)
  To: Paul Richard Thomas
  Cc: Paul Richard Thomas via Fortran, Jorge D'Elia, Jorge D'Elia

Oh, I'm not asking you or any of the other regular contributors
to gfortran to pick up my WIP patch and finish the last 5%.  Now,
lurkers on the mailing list, who have always wanted to give back,
well I'm more than willing to help explain the patch and what I
think needs to be done if they are so inclined to get their hands
dirty.

IMPORT is an interesting construct.  Originally, all entities 
are blocked from host assocation into an INTERFACE, so J3 
invented IMPORT to allow one to cherry pick entities from the
host.  gfortran's implementation is fairly straightforward.
In F2018, J3 extended IMPORT to block host-association in for
example a contained subprogram or BLOCK construct.  This seems
like a logical and good thing; except this is the complete
opposite of its original use.  Undoing/revising gfortran'sr
original implemenation of IMPORT is a bit more challenging.

-- 
steve

On Fri, Jun 02, 2023 at 09:14:01PM +0100, Paul Richard Thomas wrote:
> Hi Steve,
> 
> As noted in the previous email :-), although I didn't mention the partially
> cooked patch.
> 
> One day, once F2003 is sorted, I might turn to F2008/18!
> 
> Cheers
> 
> Paul
> 
> 
> On Fri, 2 Jun 2023, 16:27 Steve Kargl via Fortran, <fortran@gcc.gnu.org>
> wrote:
> 
> > On Fri, Jun 02, 2023 at 03:53:44PM +0100, Paul Richard Thomas via Fortran
> > wrote:
> > > Hi Jorge,
> > >
> > > As I posted in the Intel Community, the error generated by gfortran
> > > (and nagfor) is consistent with the F2003 constraint: C1210 (R1209)
> > > The IMPORT statement is allowed only in an interface-body.
> > >
> > > Could you please raise a problem report in gcc Bugzilla?
> > >
> >
> > There already is a PR about IMPORT.  See
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106035
> >
> > There is a patch that is 95-ish% complete.  The last
> > 5% is the hard part, which it seems no one has had
> > time or ideas on how to finish the patch.
> >
> > --
> > Steve
> >

-- 
Steve

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

end of thread, other threads:[~2023-06-02 21:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6b48bc0f-043f-4635-abaf-bac09d67323b.1685712510891@community.intel.com>
2023-06-02 14:12 ` A doubt about IMPORT and SELECT TYPE Jorge D'Elia
2023-06-02 14:53   ` Paul Richard Thomas
2023-06-02 15:22     ` Steve Kargl
2023-06-02 20:14       ` Paul Richard Thomas
2023-06-02 21:04         ` Steve Kargl
2023-06-02 15:19   ` 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).