public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: "José Rui Faustino de Sousa" <jrfsousa@gmail.com>,
	"Tobias Burnus" <tobias@codesourcery.com>,
	fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling
Date: Mon, 21 Jun 2021 18:46:41 +0200	[thread overview]
Message-ID: <cf707115-9386-5f1c-e423-64fbfda5194f@codesourcery.com> (raw)
In-Reply-To: <164eff68-d663-f3e3-31b0-ca0349a91dd3@gmail.com>

Hi José,

On 21.06.21 17:51, José Rui Faustino de Sousa via Fortran wrote:
> On 21/06/21 13:46, Tobias Burnus wrote:
>>
>> (in principle, I'd like to have the libgfortran function moved to the
>> compiler proper to avoid some issues, but that's admittedly a task
>> independent of your work.)
> cfi_desc_to_gfc_desc and gfc_desc_to_cfi_desc from ISO_c_binding.c,
> right?
Yes.
>
> So, I could look further into that. Were would you like them placed?
Well, as said: directly into the compiler where currently the call to
libgomp is.
>> LGTM – except for one minor nit.

Found a second tiny nit:

+  if (GFC_DESCRIPTOR_DATA (d))
+    for (n = 0; n < GFC_DESCRIPTOR_RANK (d); n++)
+      {
+       CFI_index_t lb = 1;
+
+       if (s->attribute != CFI_attribute_other)

There is tailing whitespace in the otherwise empty line.

>> In trans-expr.c's gfc_conv_gfc_desc_to_cfi_desc:
>>
>>     /* Transfer values back to gfc descriptor.  */
>> +  if (cfi_attribute != 2
>> +      && !fsym->attr.value
>> +      && fsym->attr.intent != INTENT_IN)
>>
>> Can you add after the '2' the string '  /* CFI_attribute_other. */'
>> to make the number less magic.
>
> Yes... I had the same idea... :-) But all those constants are defined
> in "ISO_Fortran_binding.h"... And moving all those definitions would
> be a major change... So I left it as it was...

Well, I am currently only asking to add a comment after the "2;".

This fixing those two nits (removing tailing whitespace + adding a
comment) and is be trivial.

* * *

However, in the long run, I think we should put it into either a
separate file, which is included into ISO_Fortran_binding.h and the
proper compiler (and installed alongside ISO_Fortran_binding.h) - or
just in libgfortran.h and adding some check/(static)assert that it
matches to the value in ISO_Fortran_binding.h.

Or, possibly, we could also include ISO_Fortran_binding.h when building
the compiler itself, possibly adding some '#ifdef' code to disable parts
we do not want when we do #include. it.

(We already have '#include "libgfortran.h"' in gcc/fortran/gfortran.h.)

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf

  reply	other threads:[~2021-06-21 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14 23:09 José Rui Faustino de Sousa
2021-06-21 13:46 ` Tobias Burnus
2021-06-21 15:51   ` José Rui Faustino de Sousa
2021-06-21 16:46     ` Tobias Burnus [this message]
2021-06-21 17:52       ` José Rui Faustino de Sousa
2021-06-21 20:29         ` Tobias Burnus
2021-06-22  7:11           ` Tobias Burnus
2021-07-26 12:43             ` Committed: " Tobias Burnus
  -- strict thread matches above, loose matches on Subject: below --
2021-06-03 15:04 [Patch, fortran] PR fortran/100120/100816/100818/100819/100821 problems raised by aggregate data types dhumieres.dominique
2021-06-04 15:24 ` Paul Richard Thomas
2021-06-05 12:40   ` dhumieres.dominique
2021-06-06 17:58     ` Re:[Patch, fortran] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling dhumieres.dominique
2021-06-19 10:57       ` [Patch, fortran v2] " dhumieres.dominique

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=cf707115-9386-5f1c-e423-64fbfda5194f@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jrfsousa@gmail.com \
    /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).