On 21.06.21 22:29, Tobias Burnus wrote:
However, that's independent from the patch you had submitted
and which is fine except for the two tiny nits.
As I just did run into a test, which does trigger the error, I think
it would be useful to have something like the following on top
of your patch – what do you think?
(Two of the changes are the nit changes I mentioned in the
LGTM approval.)
Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank
Thürauf
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 52e243bd463..73ce33185f1 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -5616,3 +5616,3 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
/* Transfer values back to gfc descriptor. */
- if (cfi_attribute != 2
+ if (cfi_attribute != 2 /* CFI_attribute_other. */
&& !fsym->attr.value
diff --git a/libgfortran/runtime/ISO_Fortran_binding.c b/libgfortran/runtime/ISO_Fortran_binding.c
index 801b7556765..1b845df0e77 100644
--- a/libgfortran/runtime/ISO_Fortran_binding.c
+++ b/libgfortran/runtime/ISO_Fortran_binding.c
@@ -56,3 +56,4 @@ cfi_desc_to_gfc_desc (gfc_array_void *d, CFI_cdesc_t **s_ptr)
default:
- internal_error (NULL, "INVALID CFI DESCRIPTOR");
+ runtime_error ("Unallocated, unassociated actual argument to "
+ "BIND(C) with non-allocatable, non-pointer dummy");
break;
@@ -94,3 +95,3 @@ cfi_desc_to_gfc_desc (gfc_array_void *d, CFI_cdesc_t **s_ptr)
CFI_index_t lb = 1;
-
+
if (s->attribute != CFI_attribute_other)
@@ -134,3 +135,4 @@ gfc_desc_to_cfi_desc (CFI_cdesc_t **d_ptr, const gfc_array_void *s)
default:
- internal_error (NULL, "INVALID GFC DESCRIPTOR");
+ runtime_error ("Unallocated, unassociated actual argument to "
+ "BIND(C) with non-allocatable, non-pointer dummy");
break;