[PATCH] Fortran: ICE in character(kind=4) deferred-length array reference [PR121939]

Harald Anlauf anlauf@gmx.de
Wed Sep 24 18:56:33 GMT 2025


Dear All,

debugging this PR sent me deep into the woods.  To find where things
went wrong, I ran two parallel gdb sessions on a testcase once with
character(kind=1) and with character(kind=4), and found that the
code diverged in get_array_span, as the TYPE_STRING_FLAG was set
for the former but not set for the latter.

I did not find why it was set at all for the former, but decided
that it should be set for all character types.  That fixed it.
(If someone thinks that I am wrong, please speak up!)

This allowed to disable the temporary workarounds I put in
testcase deferred_character_39.f90, so this should guarantee
that the present fix works and does not break something obvious.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

And for joint backport with the fix for pr108581 to 15-branch?

Thanks,
Harald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr121939.diff
Type: text/x-patch
Size: 2875 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250924/d8ae4840/attachment-0003.bin>


More information about the Fortran mailing list