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

--- Comment #4 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to Harald Anlauf from comment #3)
> (In reply to Steve Kargl from comment #2)
> > Another workaround is to place parentheses around the actual
> > argument
> > 
> >     call show((transpose(reshape([(blk(i:i), i=1, len(blk))], [w, h]))))
> 
> Indeed.
> 
> Funny.  I thought that Mikael recently addressed the issue with TRANSPOSE
> as actual argument.

I don't remember any commit, but I know he has don very cleanups
with descriptors.

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);

Reply via email to