https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128682

--- Comment #5 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
(In reply to Steve Kargl from comment #4)
> I don't remember any commit, but I know he has don very cleanups
> with descriptors.

Found it:

commit 6658c2347d4a88d82e80f44a450b14dc7287bcef
Author: Mikael Morin <[email protected]>
Date:   Fri Jul 3 11:16:04 2026 +0200

    fortran: Don't reuse original descriptors for packed arrays [PR125998]

> The ICE is coming from an assert in gfc_get_expr_charlen() at
> trans-expr.cc:2295
> 
>   gcc_assert (e->expr_type == EXPR_VARIABLE
>             && e->ts.type == BT_CHARACTER);
> 
> The comment above the function is
> 
> /* Get the character length of an expression, looking through gfc_refs
>    if necessary.  */
> 
> 
> The untested fix is to do
> 
>   gcc_assert (e->ts.type == BT_CHARACTER);
> 
> or
> 
>   gcc_assert ((e->expr_type == EXPR_VARIABLE || e->expr_type ==
> EXPR_FUNCTION)
>             && e->ts.type == BT_CHARACTER);

Looks reasonable.

This function is very old code, so we need to exercise it a bit.
Can you do that?

Reply via email to