public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: Harald Anlauf <anlauf@gmx.de>, fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH, v2] Fortran: ordering of hidden procedure arguments [PR107441]
Date: Fri, 4 Nov 2022 10:53:57 +0100	[thread overview]
Message-ID: <3ca46ea0-ee6a-cbc6-d3af-99b8db698307@orange.fr> (raw)
In-Reply-To: <ab2be683-1e67-0b10-4920-48b58068b758@gmx.de>

Le 03/11/2022 à 23:03, Harald Anlauf a écrit :
> Am 03.11.22 um 11:06 schrieb Mikael Morin:
>> Le 02/11/2022 à 22:19, Harald Anlauf via Fortran a écrit :
>>> I do see what needs to be done in gfc_get_function_type, which seems
>>> in fact very simple.  But I get really lost in create_function_arglist
>>> when trying to get the typelist right.
>>>
>>> One thing is I really don't understand how the (hidden_)typelist is
>>> managed here.  How does that macro TREE_CHAIN work?  Can we somehow
>>> chain two typelists the same way we chain arguments?
>>>
>> TREE_CHAIN is just a linked list "next" pointer like there is in the
>> fortran frontend a "next" pointer in gfc_ref or gfc_actual_arglist
>> structures.
>> Yes, we can chain typelists; the implementation of chainon in tree.cc is
>> just TREE_CHAIN appending under the hood.
>>
>>> (Failing that, I tried to split the loop over the dummy arguments in
>>> create_function_arglist into two passes, one for the optional+value
>>> variant, and one for the rest.  It turned out to be a bad idea...)
>>>
>> Not necessarily a bad idea, but one has to be careful to keep linked
>> lists synchronized with argument walking.
>>
>> The most simple, I think, is to move the hidden_typelist advancement for
>> optional, value presence arguments from the main loop to a preliminary
>> loop.
>>
>> I hope it helps.
>>
> 
> I've spent some time not only staring at create_function_arglist,
> but trying several variations handling the declared hidden parms,
> and applying the necessary adjustments to gfc_get_function_type.
> (Managing linked trees is not the issue, just understanding them.)
> I've been unable to get the declarations in sync, and would need
> help how to debug the mess I've created.  Dropping my patch for
> the time being.
> 
If you want, we can meet on IRC somewhen (tonight?).

  reply	other threads:[~2022-11-04  9:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 20:12 [PATCH] " Harald Anlauf
2022-10-30 19:23 ` Mikael Morin
2022-10-30 20:32   ` Mikael Morin
2022-10-30 21:25   ` Mikael Morin
2022-10-31  9:57     ` Mikael Morin
2022-10-31 20:29       ` [PATCH, v2] " Harald Anlauf
2022-11-02 17:20         ` Mikael Morin
2022-11-02 21:19           ` Harald Anlauf
2022-11-03 10:06             ` Mikael Morin
2022-11-03 22:03               ` Harald Anlauf
2022-11-04  9:53                 ` Mikael Morin [this message]
2022-11-07 21:45                   ` [PATCH, v3] " Harald Anlauf
2022-11-08 10:32                     ` Mikael Morin
2022-11-08 20:31                       ` Harald Anlauf
2022-11-08 21:39                         ` Mikael Morin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ca46ea0-ee6a-cbc6-d3af-99b8db698307@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).