[Patch, fortran] PR99125 - [9/10/11 Regression] ICE: gimplification failed (gimplify.c:15068)

Paul Richard Thomas paul.richard.thomas@gmail.com
Wed Feb 24 14:05:27 GMT 2021


This problem was caused by the compiler attempting to use 0 as an lvalue
and to assign 0 to it. Understandably, this upset the gimplifer quite a bit
:-) The fix is to use the ss_info string length for deferred length
character components, where the hidden string length component has been
used. The use of a constant as an lvalue is prevented by checking that the
expression string length is a variable.

Regtests on FC33/x86_64 - OK for all three branches?

Paul

Fortran: Fix for class defined operators [PR99125].

2021-02-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/99125
* trans-array.c (gfc_conv_expr_descriptor): For deferred length
length components use the ss_info string length instead of
gfc_get_expr_charlen. Make sure that the deferred string length
is a variable before assigning to it. Otherwise use the expr.
* trans-expr.c (gfc_conv_string_length): Make sure that the
deferred string length is a variable before assigning to it.

gcc/testsuite/
PR fortran/99125
* gfortran.dg/alloc_deferred_comp_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210224/9fd19ae3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alloc_deferred_comp_1.f90
Type: text/x-fortran
Size: 542 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210224/9fd19ae3/attachment-0001.bin>


More information about the Gcc-patches mailing list