public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: "José Rui Faustino de Sousa" <jrfsousa@gmail.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: Tue, 22 Jun 2021 09:11:03 +0200	[thread overview]
Message-ID: <2e7d2bde-dd2f-29fd-2a7f-d2cdb344529a@codesourcery.com> (raw)
In-Reply-To: <cb497a0e-8b8d-1b1c-a871-2b3f41bc5c7b@codesourcery.com>

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

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

[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 1403 bytes --]

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;

  reply	other threads:[~2021-06-22  7:11 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
2021-06-21 17:52       ` José Rui Faustino de Sousa
2021-06-21 20:29         ` Tobias Burnus
2021-06-22  7:11           ` Tobias Burnus [this message]
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=2e7d2bde-dd2f-29fd-2a7f-d2cdb344529a@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).