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

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #1 from kargls at comcast dot net ---
Thanks again for the report.

The ICE is caused by a NULL pointer dereference in trans-array.cc at
line 6135.

  if (expr->ts.type == BT_CHARACTER
      && expr->ts.deferred
      && VAR_P (expr->ts.u.cl->backend_decl))
    {

Here, expr->ts.u.cl->backend_decl is NULL.  If I change the code
to protect against the dereference

  if (expr->ts.type == BT_CHARACTER
      && expr->ts.deferred
      && expr->ts.u.cl->backend_decl
      && VAR_P (expr->ts.u.cl->backend_decl))
    {

and rebuild gfortran, it can then compile your code.  I don't know
if this will produce correct code.

It turns output the symtree for the expression has a backend_decl.
If I alter the code to

  if (expr->ts.type == BT_CHARACTER
      && expr->ts.deferred
      && VAR_P (expr->symtree->n.sym->backend_decl))
    {

then the new gfortran can also build your code.

Reply via email to