[PATCH] PR fortran/104128 - ICE in gfc_widechar_to_char, at fortran/scanner.c:199
Harald Anlauf
anlauf@gmx.de
Sun Jan 23 21:08:41 GMT 2022
Dear Fortranners,
conversions between different character kinds using TRANSFER exhibit
inconsistencies that can occur between expr->representation.string
(which is char*) on the one hand, and expr->->value.character.string.
One issue (in target-memory.cc) is easily fixed by simply passing
a conversion flag that was likely forgotten in the past.
The other issue happens in gfc_copy_expr. Before we unconditionally
converted an existing representation.string to wide char, which is
definitely wrong. Restricting that code path to default character
kind fixed the problems I could find and produces dumps that looked
fine to me. Maybe some expert here can find a better fix.
Regtested on x86_64-pc-linux-gnu. OK for mainline? Maybe 11-branch?
Thanks,
Harald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fortran-fix-issues-with-internal-conversion-between-.patch
Type: text/x-patch
Size: 3821 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220123/9e682f22/attachment.bin>
More information about the Gcc-patches
mailing list