Committed: Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

Tobias Burnus tobias@codesourcery.com
Mon Jul 26 12:43:26 GMT 2021


I have now committed José's patch with the two nits fixed
(cf. my on-top patch to which I just replied)

r12-2511-g0cbf03689e3e7d9d6002b8e5d159ef3716d0404c

Note:
I have slightly reworded the error message compared to both
the original patch and to my on-top suggestion.

Reason:
When calling a BIND(C) function from Fortran, it might happen
that a actual or effective argument is an allocatable or pointer
that is no allocatated/associated (→ base_addr == NULL) but whose
dtype.attribute is 'other' as the dummy argument is
nonallocatable/nonpointer.
Likewise, when passing a base_addr == NULL from C to a Fortran-written
BIND(C) procedure where attribute == CFI_attribute_other.

Those errors are much more likely than having some other bug. Thus,
those get now an error on their own instead of a generic error,
even though the reason can be the same as for:

On the other hand, if the attribute != 0, 1, 2 it is invalid, which
either is a bug in the compiler, random/uninitialized memory or a
bug in the C code setting up the descriptor. Thus, the error message
is now different.

Comments to the new wording + comments/remarks to this commit
(or any new or existing code) are welcome :-)

Thanks,

Tobias

PS: I wrote:

On 22.06.21 09:11, Tobias Burnus wrote:

> 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.)
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: committed.diff
Type: text/x-patch
Size: 35274 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210726/955caf72/attachment-0001.bin>


More information about the Gcc-patches mailing list