On 21/06/21 13:46, Tobias Burnus wrote:
Hi José,

(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?

Since fixing:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100917

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100910

would very likely require passing an additional "kind" parameter (and future descriptor unification) that would be a good idea.

I had a patch to do this, passing the kind value, but AFAIR there were issues with kind values for C_PTR and C_FUNPTR (and I didn't want to mess with the ABI also in one go)... But I might have fixed that somewhere else afterwards...

So, I could look further into that. Were would you like them placed?

LGTM – except for one minor nit. 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...

What do you suggest I do?

Best regards,
José Rui



Reply via email to