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

--- Comment #4 from MarkEggleston <mark.eggleston at codethink dot com> ---
reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op,
              gfc_expr **result)
{
  gfc_constructor_base head;
  gfc_constructor *c;
  gfc_expr *r;
  arith rc;

  if (op->expr_type == EXPR_CONSTANT)
    return eval (op, result);

  rc = ARITH_OK;
  head = gfc_constructor_copy (op->value.constructor);
  for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c))
    {
      rc = reduce_unary (eval, c->expr, &r);

      if (rc != ARITH_OK)
        break;

      gfc_replace_expr (c->expr, r);
    }

  if (rc != ARITH_OK)
    gfc_constructor_free (head);
  else
    {
      gfc_constructor *c = gfc_constructor_first (head);

!!! Crashes because c is NULL

      r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind,
                              &op->where);      r->shape = gfc_copy_shape
(op->shape, op->rank);
      r->rank = op->rank;
      r->value.constructor = head;
      *result = r;
    }

  return rc;
}


The ICE is indicated above. The routine is called, then called again
recursively, it would seem that the constructor is missing when
-fno-range-check is omitted.  Judging by comments 1 & 3 there is a missing
error message.

Reply via email to