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

markeggleston at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markeggleston at gcc dot 
gnu.org

--- Comment #2 from markeggleston at gcc dot gnu.org ---
Using newer initialisation:

program test
  character :: c(2) = [ 'a', 'b'(1:1) ]
  character :: d(2) = [ 'a', 'bc'(1:1) ]
  write(*,*) c, d
end program test

compiles and runs:

abab

master at https://gcc.gnu.org/g:e82ba180d6641a1e2bad1ac327234fc1cda658ef

Also compiles and runs using the commit indicated in comment 1.

Checking the code for the ICE. In this loop

      for (c = gfc_constructor_first (expr->value.constructor);
           c; c = gfc_constructor_next (c))
        {
          if (c->iterator)
            return false;
          if (c->expr->expr_type == EXPR_STRUCTURE)
            {
              if (!check_constant_initializer (c->expr, ts, false, false))
                return false;
            }
          else if (c->expr->expr_type != EXPR_CONSTANT)
            return false;
        }

in check_constant_initializer the value of c->expr on the second iteration is
NULL.

Reply via email to